-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
x86_64-darwin: fix packages that won’t build #180931
base: master
Are you sure you want to change the base?
Conversation
d9e738b
to
469bb27
Compare
469bb27
to
e349cb4
Compare
I rebased on staging. That’s way more rebuilds than I expected. |
I converted the PR to a draft because it looks like nixpkgs-review is identifying more things that are broken, which should probably be addressed in a “fix the broken things on Darwin” PR. |
ea2917e
to
d5b70be
Compare
Based on feedback from @SuperSandro2000, I’ve split the MoltenVK changes off into a separate PR (#180988) to keep this one focused on fixing packages that were marked broken on Darwin. |
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.
Pretty much all of this LGTM.
@@ -31,14 +41,5 @@ rustPlatform.buildRustPackage rec { | |||
homepage = "https://rustpython.github.io"; | |||
license = licenses.mit; | |||
maintainers = with maintainers; [ prusnak ]; | |||
|
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.
Maybe we can leave a TODO here to switch back away from the SDK when stdenv gets bumped to 10.13, if that is enough?
@@ -28,10 +28,6 @@ rustPlatform.buildRustPackage rec { | |||
homepage = "https://bupstash.io"; | |||
license = licenses.mit; | |||
platforms = platforms.unix; | |||
# = note: Undefined symbols for architecture x86_64: |
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 looks like another one that might work with the stdenv bump to 10.13. Another TODO?
@@ -21,17 +21,5 @@ stdenv.mkDerivation rec { | |||
license = licenses.gpl3Plus; | |||
maintainers = with maintainers; [ qyliss ]; | |||
platforms = platforms.unix; | |||
|
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.
utimensat
will be in the stdenv bump to 10.13, TODO?
@@ -46,7 +46,7 @@ let | |||
inherit MacOSX-SDK; | |||
|
|||
Libsystem = callPackage ./libSystem.nix {}; | |||
LibsystemCross = pkgs.darwin.Libsystem; | |||
LibsystemCross = packages.Libsystem; |
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.
Are we sure this is fine? I feel like it'd have been defined as an alias before if that was the case.
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.
Not sure I follow. Aren’t aliases for deprecated names?
This change was to correct what I believe was a mistake in the previous patch. The 11.0 SDK originally assumed that pkgs.darwin.Libsystem
belongs to the SDK, but that’s not necessarily the case. On x86_64-darwin, that’s the 10.12 SDK.
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.
What I meant with an alias was rec { Libsystem = ...; LibsystemCross = Libsystem; }
, not aliases.nix
.
I'm really not sure how cross works in Nix. But I do suspect LibsystemCross
might have to be different from Libsystem
in some way, no?
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. It’s not currently different on aarch64-darwin, so I propagated that here. I assume it works because Apple’s SDK is naturally cross-capable.
}; | ||
in | ||
if !needsOverrides then stdenv | ||
else overridePlatformDarwinVersions (pkgs.overrideCC stdenv clang) "10.12" "11.0"; |
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'm having some trouble keeping track of all the overrides.
Is this stdenv the standard stdenv, based on the source releases for 10.12, with an overridden compiler that is based on SDK Libsystem? Is that the only reference to system libraries from stdenv? Or is this completely taken care of by the inherit in callPackage?
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.
It’s the 10.12 stdenv with the compiler and SDK Libsystem replaced. This is the same implementation as in current master just moved to a new file and with build/hostPlatform overridden. I couldn’t see a way to build a pure 11.0 SDK without doing surgery on the Darwin stdenv definition.
I originally wrote the overridePlatformDarwinVersions
function to use with overriding the GCC stdenv, but it turns out that builds fine from the private nixpkgs. If it would improve clarity, I can inline the function definition, so it’s more like how things are currently on master.
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 function is perfectly fine.
What I'm concerned about here is that apple_sdk_11_0.stdenv
is still using the 10.12 SDK somehow. Having a bootstrap stage is totally reasonable if that's what it takes. If it's no problem whatsoever then so much the better : )
I’ve got an updated reflecting the changes requested here plus also discussed on Matrix. I’m waiting for it to build successfully before pushing. It now uses a clang built in the 11.0 SDK stdenv instead of one from the 10.12 SDK with overrides. |
I also added |
Converting this to draft while I work through the stdenv stuff. |
Result of 4 packages marked as broken and skipped:
1 package failed to build:
34 packages built:
|
@reckenrode Could you look at Trivy as part of this PR too, please? I suspect that should work now too: nixpkgs/pkgs/tools/admin/trivy/default.nix Lines 52 to 54 in 0906692
Edit: Sorry, I made this comment too quickly and just realized you called out Go packages as being worked on in #179622 . So maybe Trivy isn't relevant here in your PR? But I don't see Trivy being unmarked as broken in that PR either so I don't know where it belongs. |
Based on what @SuperSandro2000 said in #180704, I believe the plan is to address those packages in a follow up PR to keep the Go 1.18 update PR from growing out of hand. |
This should be broken to individual pull requests, since some of the packages have already been fixed elsewhere. |
Description of changes
#176661 allows x86_64-darwin to use the 11.0 SDK. This PR fixes most packages that were flagged as broken on x86_64darwin. It also reworks the MoltenVK derivation to build without needing Xcode (and bumps it because that patch has been sitting in my queue along with the Xcode build change). There are two exceptions:
nixpkgs-review
, I will probably include fixes to broken packages that depend on SDL2.I also updated the SDK-specific
callPackage
to make it more robust. It also now provides a couple of GCC stdenvs andrustPlatform
.Sandboxing is set to relaxed. I had to add a
sandboxProfile
to ccl to let it build with sandboxing.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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes