New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use xcrun --show-sdk-version
to determine macOS SDK version
#2115
Conversation
This approach should be more reliable than grepping the SDK path, and allow using an SDK whose path doesn’t indicate the version.
When I implemented initial patch, I tried |
I had tried this change on my Mac which currently doesn’t have full Xcode, only the command line tools, and only up to the point in the configuration where I could tell the change worked (i.e. without fully building ispc; notice SDK version is then reported as 10.15.6 rather than 10.15):
Unfortunately I now notice this change doesn’t prevent issues for MacPorts CI builds, which do use full Xcode (see macports/macports-ports#11487). I’m not aware why it doesn’t work; my guess is that xcrun behaves differently under full Xcode (which has xcodebuild).
Does this resemble the issue previously encountered with |
I think that's what I had, so I decided to go with current patch. |
It appears that |
@chrstphrchvz what is your specific problem here that you are trying to solve? Here's what I have on my system by default:
Note that real folder is So if we check the name before (or before and after) dereferencing symlink, would that solve your problem? PS. Experimenting further I see that doing either |
My impression is that it is preferable to allow arbitrary SDK paths by relying on a “proper” way of retrieving the SDK version, and avoid making any assumptions about the path. I don’t think MacPorts for example can rely on the SDK to have certain a path especially on user machines; it’s something outside of its control. The next approach I’m inclined to investigate is to use Essentially what is wanted is |
Yeah, At this point it seems to me that the best way is to try |
@chrstphrchvz what do you think about checking this in two steps? Does this sound like the right approach to you? |
I am no longer investigating this issue, sorry. |
This approach should be more reliable than grepping the SDK path, and allow using an SDK whose path doesn’t indicate the version.
MacPorts provides a port for ispc. I notice that its builds for ispc 1.16.0 failed on macOS 10.15 and earlier: the SDK version fails to be detected, and this leads to trying to build ARM support when the SDK doesn’t support it:
I based this approach on existing usage of
xcrun
in CMakeLists.txt, but I am not familiar with CMake, so I would appreciate others’ reviews.Ping @dbabokin (author of the affected portions of CMakeLists.txt)