10.14.6 SDK xCode commandline tools error -- but files are there

Running Mojave 10.14.6 with xCode Version 11.3.1 (11C504)


I'm trying to build from source via terminal a software package and am getting the following error:


# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.breakpad] Error 64


The files however ARE there:


pwd
/Library/Developer/CommandLineTools/SDKs
McKinley:SDKs XY15$ ls -la
total 0
drwxr-xr-x 4 XY15 staff 128 Jul 23 2019 .
drwxr-xr-x 6 XY15 staff 192 Jan 31 2019 ..
drwxr-xr-x 7 XY15 staff 224 Jul 23 2019 MacOSX.sdk
lrwxr-xr-x 1 XY15 staff 10 Jul 23 2019 MacOSX10.14.sdk -> MacOSX.sdk
McKinley:SDKs XY15$


The source code developer's recommendation is that "only apple knows why this happens, remove commandline tools or delete the directory for them". That doesn't seem acceptable.


What could be causing this and HOW can I fix it? TIA.


MacBook Pro Retina

Posted on Jun 18, 2020 11:38 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 19, 2020 10:55 AM

easelpad wrote:

@etresoft - thanks. Can you please share what the *correct* specification for what that command would be? This is coming from a compile I'm doing against a source called VLC. I'm not specifying the command, it's embedded into the compile and this is the point where it crashes.

I just did "./configure" to build breakpad itself. I didn't look at anything in VLC.

I am happy to post the build / configure and support scripts he uses -- he sets a "$MINIMAL_OSX_VERSION" to be 10.11 -- in some cases 10.7 -- that *may* be where that's coming from.

I was wrong about the MACOSX_DEPLOYMENT_TARGET. I thought that was talking about the SDK version. Apparently that is the minimum deployment version. Ideally, all of those should be the same, either 10.7 or 10.11, but it should be fine.


In my projects I have the deployment version hard-coded. I don't see how that could or should be variable based on an environment setting. If the code requires 10.11 APIs, I don't see why you would want to allow a crashing version to be deployed on 10.10. And I also don't see why you would want to change the minimum to 10.12 if you only need 10.11. Just hard-code it to what the code really requires.


I took another look at what you posted. You are actually trying the build inside the client/Mac/ subdirectory. I'm not sure what that is. It looks like it builds the lower-level breakpad framework and a bunch of other things. That command is just wrong. When I try it with only command line tools installed, I get the following error:


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


That's pretty straightforward. But when I try that command with just Xcode installed, I get the same error you did. I'm not going to attempt to install both Xcode and command line tools. All you need to do is change that command and remove the sdk flag, like so:


xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11  WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++ 


The command succeeds, but I don't think it actually works. There are some failures, that aren't actually errors, related to code signing. Ironically enough, the signing identity is something that would be better to pass on the command line.


I build a lot of code from various open-source libraries. There is no easy way to do it. Generally speaking, you should never, ever use any provided "Mac version". Those are generally hacked-up messes that worked once years ago and no one has checked it since. It is better to just build as if you are Linux or some generic UNIX. That would be via the "./configure". About 80% of the time, that works just fine. Usually the only time you need to make modifications is when the project has some hacked-up Mac support from ages ago.


If you are just building for your own machine, then this is pretty easy to manage. If you need to distribute it, then it will be more complicated. This is especially true if you are trying to do an iOS version. There are a number of different approaches, depending on what you need out of the project. I do all of my current work for distribution on both macOS and iOS, so I have the most complicated version. But if you don't need to distribute, you could even just do "./configure; sudo make install" and that will generally work. Any higher-level code that needs those libs should find them in /usr/local. If not, they can be easily modified to look there.

Similar questions

4 replies
Question marked as Top-ranking reply

Jun 19, 2020 10:55 AM in response to easelpad

easelpad wrote:

@etresoft - thanks. Can you please share what the *correct* specification for what that command would be? This is coming from a compile I'm doing against a source called VLC. I'm not specifying the command, it's embedded into the compile and this is the point where it crashes.

I just did "./configure" to build breakpad itself. I didn't look at anything in VLC.

I am happy to post the build / configure and support scripts he uses -- he sets a "$MINIMAL_OSX_VERSION" to be 10.11 -- in some cases 10.7 -- that *may* be where that's coming from.

I was wrong about the MACOSX_DEPLOYMENT_TARGET. I thought that was talking about the SDK version. Apparently that is the minimum deployment version. Ideally, all of those should be the same, either 10.7 or 10.11, but it should be fine.


In my projects I have the deployment version hard-coded. I don't see how that could or should be variable based on an environment setting. If the code requires 10.11 APIs, I don't see why you would want to allow a crashing version to be deployed on 10.10. And I also don't see why you would want to change the minimum to 10.12 if you only need 10.11. Just hard-code it to what the code really requires.


I took another look at what you posted. You are actually trying the build inside the client/Mac/ subdirectory. I'm not sure what that is. It looks like it builds the lower-level breakpad framework and a bunch of other things. That command is just wrong. When I try it with only command line tools installed, I get the following error:


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


That's pretty straightforward. But when I try that command with just Xcode installed, I get the same error you did. I'm not going to attempt to install both Xcode and command line tools. All you need to do is change that command and remove the sdk flag, like so:


xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11  WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++ 


The command succeeds, but I don't think it actually works. There are some failures, that aren't actually errors, related to code signing. Ironically enough, the signing identity is something that would be better to pass on the command line.


I build a lot of code from various open-source libraries. There is no easy way to do it. Generally speaking, you should never, ever use any provided "Mac version". Those are generally hacked-up messes that worked once years ago and no one has checked it since. It is better to just build as if you are Linux or some generic UNIX. That would be via the "./configure". About 80% of the time, that works just fine. Usually the only time you need to make modifications is when the project has some hacked-up Mac support from ages ago.


If you are just building for your own machine, then this is pretty easy to manage. If you need to distribute it, then it will be more complicated. This is especially true if you are trying to do an iOS version. There are a number of different approaches, depending on what you need out of the project. I do all of my current work for distribution on both macOS and iOS, so I have the most complicated version. But if you don't need to distribute, you could even just do "./configure; sudo make install" and that will generally work. Any higher-level code that needs those libs should find them in /usr/local. If not, they can be easily modified to look there.

Jun 18, 2020 4:37 PM in response to easelpad

I just installed the command line tools and breakpad and it built without any problem. All I had to do was type "./configure".


I don't know where you got that command, but it appears to be completely wrong. It looks like it is trying to use the 10.11 SDK and specifying it incorrectly. I checked the docs for that project under the "Mac starter guide" and it makes references to PPC circa 2004 or so. While the code builds, I have no idea if it will work.

Jun 19, 2020 7:49 AM in response to etresoft

@etresoft - thanks. Can you please share what the *correct* specification for what that command would be? This is coming from a compile I'm doing against a source called VLC. I'm not specifying the command, it's embedded into the compile and this is the point where it crashes.


The developer has publicly stated that he doesn't know why this doesn't work, "only Apple knows", but has suggested I just remove commandline tools and all will be fine. That makes no sense and I use it for other purposes. I've successfully compiled a different (beta) version of his code and don't get that error -- however I'm doing some cross platform development and need the base version on my mac to be the same as the one we're building under Linux. So, I need to try to solve this issue.


I am happy to post the build / configure and support scripts he uses -- he sets a "$MINIMAL_OSX_VERSION" to be 10.11 -- in some cases 10.7 -- that *may* be where that's coming from.


Either way, I'm trying to help solve this and post back to the community so that a: I can continue to move forward; b: others can continue rolling their work forward on their mac's as well.


If you could share the correct specification for that command I would *greatly* appreciate it.


Many thanks in advance for any insights you can lend.

Jun 21, 2020 7:58 AM in response to etresoft

@etresoft - thanks for this very thoughtful and thorough response. Based on your comments, I've started to dig into his code a bit and will relay the suggestion to remove the -sdk switch. The distribution *does* provide sources for all the components needed, like breakpad, etc. so he's not relying on anything previously installed on the system. Those all get compiled in every time we do a build -- and the subdirectory you reference (client/Mac) is part of those source tree.


I'll try removing commandline tools again and see what happens. Thanks again for your suggestions.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

10.14.6 SDK xCode commandline tools error -- but files are there

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.