Strange Xcode behavior


Owen Hartnett
 

I’ve set up a remote build server, and a project that had been building fine is suddenly giving very strange errors.

This is an objective C project with one Swift file in it.  The project, when attempting to compile, shows an error:

<module-includes>:74:9: note: in file included from <module-includes>:74:
#import "net/if_dl.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/net/if_dl.h:93:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  sdl_len;        /* Total length of sockaddr */
        ^
<module-includes>:74:9: note: in file included from <module-includes>:74:
#import "net/if_dl.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/net/if_dl.h:94:2: error: unknown type name 'u_char'; did you mean 'char'?
        u_char  sdl_family;     /* AF_LINK */
        ^

repeated 27 times, for each instance of u_char in the if_dl.h file. It fails when trying to compile the only Swift file.

If I copy the entire project folder to my laptop, it compiles fine without the above messages. Other team members also have no problems compiling it.  It is only on this one computer.  The source is checked out from git, there seems to be no differences in setup that I can tell.  I suppose I could drop a define for u_char in the settings, but I’d really like to find out why this is happening.  This if_dl.h file looks like a holdover from 2011.  The server is being used as a remote xcode server, and I’ve also been testing fastlane on it, but no code changes in the project itself.

-Owen

Join xcode@apple-dev.groups.io to automatically receive all group messages.