Skip to content
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

build: removing xcrun from darwin build #21341

Closed

Conversation

ivanacostarubio
Copy link

Hello,

I'm tackling the issue: #18959

Initial discussion: #18743 (comment)

I was not able to remove the xcrun invocation to get the SDK path. All others removed.

We can see below how this behaves when multiple Xcode are present and we switch among them.

$ sudo xcode-select --switch /Applications/Xcode11.7.app

$  make -C depends print-darwin_CXX
darwin_CXX = clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Applications/Xcode11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

$ clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Applications/Xcode11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --version
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode11.7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ sudo xcode-select --switch /Applications/Xcode12.3.app/

$  make -C depends print-darwin_CXX
darwin_CXX = clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Applications/Xcode12.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

$ clang++ -mmacosx-version-min=10.14 -stdlib=libc++ --sysroot /Applications/Xcode12.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --version
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode12.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@dongcarl
Copy link
Contributor

dongcarl commented Mar 3, 2021

Not sure we reached a conclusion on that issue, but your contribution here is very worthwhile: the fact that we need xcrun to get the SDK path says to me that we should actually keep all the xcrun calls, since we can expect xcrun to be consistent with itself. What I mean is: the SDK that xcrun returns is more likely to be compatible with the clang that xcrun returns than just a bare clang.

@fanquake
Copy link
Member

fanquake commented Mar 4, 2021

I think Carl's comments make sense, and we can just leave this as is for now. We can close #18959 as a "wont change". Thanks for the investigation, and for putting together a PR @ivanacostarubio. Feel free to grab another good first issue and ping me if you have any questions.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 4, 2021

Guix builds

File commit 9212e67
(master)
commit e3d010f
(master and this pull)
*-aarch64-linux-gnu-debug.tar.gz 7c4e2b7f7b7e08a3... dda361b1fdb6e1b0...
*-aarch64-linux-gnu.tar.gz e099872c0b0f3c04... 29c5f899a9599117...
*-arm-linux-gnueabihf-debug.tar.gz 79dbf1c1bb7ba758... 36a7a67770156c17...
*-arm-linux-gnueabihf.tar.gz 0b18756fdb3c85f3... 2aa8e56fc1399d68...
*-osx-unsigned.dmg 2b0245b1fa1ee744... eea5453668fd17b5...
*-osx-unsigned.tar.gz efe02c8bd6bf1c56... ba75a9d32009d9bf...
*-osx64.tar.gz 94512611694d575e... 9fc7825b0a07c238...
*-powerpc64-linux-gnu-debug.tar.gz bac482b02a75711c... 6b886809fd32a50e...
*-powerpc64-linux-gnu.tar.gz 9ab68ffa85b64620... a806b3dac972d623...
*-powerpc64le-linux-gnu-debug.tar.gz 2fac9038e6c90ea4... 5ae35e79790621a5...
*-powerpc64le-linux-gnu.tar.gz 67c8bab214dbf998... 234a98529c5f9863...
*-riscv64-linux-gnu-debug.tar.gz e9334b54f1743f8c... a3a47cf01273fd70...
*-riscv64-linux-gnu.tar.gz 104be99be035aa07... de12b896e8c7b715...
*-win-unsigned.tar.gz 01dc26708072002b... 648a21d625d4fd1e...
*-win64-debug.zip ce517409c7624d28... 852c8cf6ec6e0e59...
*-win64-setup-unsigned.exe 73bcc94ed2e90ee6... 669e132e05bf111f...
*-win64.zip 995d9f34a5779d41... f89bc2a1cb78f1a5...
*-x86_64-linux-gnu-debug.tar.gz 5ee23de73377ceb5... b7a899056e2ab8bb...
*-x86_64-linux-gnu.tar.gz 6c0c194cd088df6a... 80bd342025c2ce9c...
*.tar.gz 2e8b970a9ba9bc44... 095688a4a2945353...
guix_build.log c94b5568ba42535d... 6590e140e1b09b20...
guix_build.log.diff da0fea5697dbdc10...

@ivanacostarubio ivanacostarubio deleted the removing_xcrum branch March 5, 2021 14:35
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants