-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
compiler-rt: build builtins on darwin #186575
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
pkgs/development/compilers/llvm/common/compiler-rt/darwin-plistbuddy-workaround.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
CMake tries to read a list field from SDKSettings.plist, but the output of | ||
xcbuild PlistBuddy is incompatible with Apple's. (Plus we don't want it in our | ||
dependencies.) | ||
|
||
Simply assume ARM64 is supported by the SDK. We already limit the actual archs | ||
we build for by setting DARWIN_osx_BUILTIN_ARCHS explicitely. | ||
|
||
--- a/cmake/builtin-config-ix.cmake | ||
+++ b/cmake/builtin-config-ix.cmake | ||
@@ -97,14 +97,7 @@ if(APPLE) | ||
set(DARWIN_osx_BUILTIN_MIN_VER 10.5) | ||
set(DARWIN_osx_BUILTIN_MIN_VER_FLAG | ||
-mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER}) | ||
- set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64}) | ||
- # Add support for arm64 macOS if available in SDK. | ||
- foreach(arch ${ARM64}) | ||
- sdk_has_arch_support(${DARWIN_osx_SYSROOT} macosx ${arch} MACOS_ARM_SUPPORT) | ||
- if (MACOS_ARM_SUPPORT) | ||
- list(APPEND DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${arch}) | ||
- endif() | ||
- endforeach(arch) | ||
+ set(DARWIN_osx_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64} ${ARM64}) | ||
|
||
if(COMPILER_RT_ENABLE_IOS) | ||
list(APPEND DARWIN_EMBEDDED_PLATFORMS ios) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't fly. Hydra doesn't do xcbuild and since this is in the stdenv, we wouldn't get any darwin builds whatsoever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, what prevents hydra from building xcbuild? I tried to make it stdenv-friendly in #185969 by exposing
xcrun
separately, which is just some text files generated by Nix. If that doesn't work, then I guess we'll have to patch the CMake files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that builders don't have no Xcode installed (to my knowledge) and that it's highly impure to run external build tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, but we don't really use Xcode or the SDKs, just emulate them. For example, our
xcrun
is this shell script:nixpkgs/pkgs/development/tools/xcbuild/wrapper.nix
Lines 54 to 97 in ab26522
And it references fake macOS SDK and platform directories that are generated plist files. Its entire closure is:
I believe it should be fine, but will try to verify. I thought I was already on a clean macOS, working on a machine provisioned by Scaleway, but it seems Xcode is already on it. I'll delete and try a rebuild.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed Xcode and Command-Line Tools, cleaned up my Nix store, then did a rebuild, and stdenv builds correctly. (I did find an impurity in my Swift PR, so good thing we tried!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay then, I was concerned because it's located under the xcbuild umbrella. Since it isn't really related to xcode, wouldn't it be best to give it a more fitting name and put it somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's related in the sense that xcbuild, xcrun, xcode-select, etc all emulate Xcode tooling. It's probably called xcbuild because the core tool its packaging is facebook/xcbuild? And the rest of it is small Nix shims.
But facebook/xcbuild is also unmaintained. It looks like we have several dozen packages using it, though not sure how many use the xcbuild parts, and how many just need the Nix shims. Also not sure how well it is capable of building newer Xcode projects (including Swift stuff).
It might make sense to move the non-xcbuild stuff to a separate top-level attribute, like
xcode-shims
? Maybe @matthewbauer has a stronger opinion. 🙂