Ceedling Broken after updating to XCode 5

172 views
Skip to first unread message

Jordan Schaenzle

unread,
Oct 25, 2013, 4:48:34 PM10/25/13
to throwth...@googlegroups.com

I just installed the new version of OSX (mavricks) which prompted me to update XCode command line tools to the new version 5.0

It seems to have broken Ceedling.

Installed the temp_sensor example.
Run rake release
FAIL. (See output below)

Haven't found a solution yet. Any ideas?


DrSheldon:temp_sensor_new jordanschaenzle$ rake test:all

Test 'TestAdcConductor.c'

In file included from build/temp/TestAdcConductor.c:5:
In file included from src/Types.h:4:
In file included from /usr/include/math.h:31:
In file included from /usr/include/Availability.h:148:
/usr/include/AvailabilityInternal.h:4098:10: error: #else without #if
#else
^
/usr/include/AvailabilityInternal.h:4158:10: error: unterminated conditional directive
#if _
MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_6
^
/usr/include/AvailabilityInternal.h:4131:10: error: unterminated conditional directive
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_5
^
/usr/include/AvailabilityInternal.h:4108:10: error: unterminated conditional directive
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_4
^
4 errors generated.
ERROR: Shell command failed.

Shell executed command:
'cpp -MM -MG -I"test" -I"test/support" -I"src" -DTEST -DTEST -DGNU_PREPROCESSOR -w -nostdinc "build/temp/TestAdcConductor.c"'
Produced output:
_TestAdcConductor.o: build/temp/
TestAdcConductor.c unity.h @@@@unity.h \
test/support/UnityHelper.h @@@@UnityHelper.h src/Types.h @@@@Types.h \
src/AdcConductor.h @@@@AdcConductor.h MockAdcModel.h \
@@@@MockAdcModel.h MockAdcHardware.h @@@@MockAdcHardware.h
And exited with status: [1].

rake aborted!
ShellExecutionException
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/tool_executor.rb:71:inexec'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator_includes_handler.rb:28:in
form_shallow_dependencies_rule'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator.rb:31:inpreprocess_shallow_includes'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator.rb:11:in
block in setup'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator_helper.rb:11:in call'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator_helper.rb:11:in
preprocess_includes'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/preprocessinator.rb:17:inpreprocess_test_and_invoke_test_mocks'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/test_invoker.rb:42:in
block in setup_and_invoke'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/test_invoker.rb:32:insetup_and_invoke'
/Users/jordanschaenzle/Dropbox/Projects/DemoProjects/temp_sensor_new/vendor/ceedling/lib/tasks_tests.rake:8:in
block (2 levels) in '
Tasks: TOP => test:all
(See full trace by running task with --trace)

gbing...@gmail.com

unread,
Nov 18, 2013, 3:35:36 PM11/18/13
to throwth...@googlegroups.com, scha...@atomicobject.com
I just ran into the same thing. I don't know why the include of AvailabilityInternal.h is failing; I didn't sift through the 1000s of lines. But I do know that I don't need it because it seems to only relate to version handling among various versions of iOS and OSX. This is a bit of a hack, but until something better comes along, you can put __AVAILABILITY__ in the preprocessor defines of the ceedling yml file:

:defines:
  # in order to add common defines:
  #  1) remove the trailing [] from the :common: section
  #  2) add entries to the :common: section (e.g. :test: has TEST defined)
  :common: &common_defines []
  :test:
    - *common_defines
    - TEST
    - __AVAILABILITY__ # avoid Xcode 5 compile error
  :test_preprocess:
    - *common_defines
    - TEST

This way, the contents of Availability.h get skipped when it gets included. (In my case it was being included through string.h).

Scott Vokes

unread,
Nov 18, 2013, 3:37:51 PM11/18/13
to throwth...@googlegroups.com, scha...@atomicobject.com
The underlying issue appears to be a subtle incompatibility between gcc's preprocessor and OSX's clang wrapper that emulates its interface.

Scott 


--
You received this message because you are subscribed to the Google Groups "ThrowTheSwitch Science Forums" group.
To unsubscribe from this group and stop receiving emails from it, send an email to throwtheswitc...@googlegroups.com.
To post to this group, send email to throwth...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/throwtheswitch/64269ed6-b826-443f-9d33-c9acf262a8af%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Scott Vokes
Atomic Embedded | http://atomicembedded.com
[Ph] 616-295-6690

capt.dav...@gmail.com

unread,
Mar 27, 2014, 9:59:39 PM3/27/14
to throwth...@googlegroups.com, scha...@atomicobject.com
I don't agree, Scott. This seems to be caused by the preprocessornator. Sure, maybe it only is seen when using OSX Clang...

For example, I also see this when I use limits.h, or stdio.h. So this is not a minor problem.

I can get rid of a bunch of problems by specifying lots of overrides for the compiler in tools section of project.yml, but the problem stays ahead of me, crops up in yet another include file...

Is there some way to get the preprocessed files in build/temp to remain? Then perhaps I could see what was going wrong.

capt.dav...@gmail.com

unread,
Apr 1, 2014, 5:53:21 PM4/1/14
to throwth...@googlegroups.com, scha...@atomicobject.com
OK, I think I understand the problem now. The problem is in perception of the user, so the solution may require some deep thought.

The problem is that, before compiling, the ceedling rakefile pre-processes source in order to obtain "makedepend" data. When it does so, it turns off including the standard include files. I am not sure why it does so. But these standard include files are not included. Hence, when some include file IS included that uses preprocessor information from a non-included file, then the pre-processing pass fails with errors.

The perception of the user (at least, the perception of this user) is that the compile broke, rather than just the "pre-process to get dependency data" step breaks. 

It appears that the preprocessinator is the code that does this preprocessing.

Unfortunately, the failure of the preprocessinator pass causes the tests to fail. So, as I said before, this is a big problem.

I figured out a horrible hack to get around this problem which otherwise is a show stopper: in project.yml, in the list of flags for pre-processing, I added lines such as "-D_BUSTED_INCLUDE_FILE_H_" to cause the preprocessor to skip processing the include files that fail due to the weird way some include files are not processed by the preprocessinator code.

I think the solution is to just include everything (eliminate the -nostdinc flag). Again, I don't understand why the preprocessinator thinks it can ignore some include files, and not others. So I am afraid to change anything in the preprocessinator. The horrible hack (which is what was suggested to get around the _AVAILABILITY_ symptom of this bug) seems to work, but it sure feels wrong.
Reply all
Reply to author
Forward
0 new messages