-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
swift: use stdenv libc++ on Darwin #245641
Conversation
Result of 6 packages marked as broken and skipped:
9 packages failed to build:
36 packages built:
|
Result of 3 packages marked as broken and skipped:
4 packages failed to build:
18 packages built:
|
|
llvmPackages_15.clang.override rec { | ||
libc = apple_sdk.Libsystem; | ||
bintools = pkgs.bintools.override { inherit libc; }; | ||
# Ensure that Swift’s internal clang is using the same libc++ and libc++abi | ||
# used by the default Darwin stdenv. | ||
libcxx = pkgs.llvmPackages.libcxx; | ||
extraPackages = [ | ||
pkgs.llvmPackages.libcxxabi | ||
(pkgs.llvmPackages_15.compiler-rt.override { | ||
inherit (pkgs.llvmPackages) libcxxabi; | ||
}) | ||
]; | ||
} |
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.
Now that llvmPackages_15
is repeated twice, can we turn this into a function, something like:
if pkgs.stdenv.isDarwin then
# Comments here
let makeSwiftClang = stdenvLLVM: targetLLVM:
...
in
makeSwiftClang pkgs.llvmPackages llvmPackages_15
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.
How’s the current push look like with the alias (swiftLlvmPackages
)? I can still rework it to use a function, but it’s only going to be used right away, so it seems like it would add a limited amount of clarity.
3c58bda
to
3595e01
Compare
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.
LGTM
3595e01
to
8b124ad
Compare
Swift uses libc++ 15, but it should really be using the same libc++ from the stdenv. While not strictly needed currently, Swift 5.9 will support C++ interop. If Swift is not using the stdenv C++, any C++ library used with interop would need to be rebuilt against the Swift libc++.
8b124ad
to
efdf4e9
Compare
Description of changes
Swift uses libc++ 15, but it should really be using the same libc++ from the stdenv. While not strictly needed currently, Swift 5.9 will support C++ interop. If Swift is not using the stdenv C++, any C++ library used with interop would need to be rebuilt against the Swift libc++.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)