-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
go_1_18: Use apple_sdk_11_0.callPackage #180704
Conversation
Go 1.18 requires a newer SDK than the one we build from sources. As a workaround we're making use of the SDK we're using for aarch64-darwin. This means Go 1.18 will not work on any Darwin systems that don't have forwards-compatible SDK versions with the particular package in question. We might need to mark Go packages broken based on the macOS version rather than just the platform and architecture. Until we find a better solution, Go packages will need to make sure to get all their (Darwin) system dependencies from the `apple_sdk_11_0`, this includes dependencies of build tools like `xcbuild`. For convenience `darwin.apple_sdk_11_0` has a `callPackage` attribute which provides the correct `stdenv` and `xcbuild` attributes as arguments. This function can be expanded to substitute other necessary arguments when they come up.
go_1_18 = darwin.apple_sdk_11_0.callPackage ../development/compilers/go/1.18.nix { | ||
inherit (darwin.apple_sdk_11_0.frameworks) Security Foundation; | ||
}; |
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 wouldn't mind a comment here
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 think the easiest is that I cherry-pick the darwin fix commit into my branch when it is done because I need to rebase that on master again to remove new occurrences of buildGo118Module
@@ -21753,20 +21700,20 @@ with pkgs; | |||
buildGo117Package = callPackage ../development/go-packages/generic { | |||
go = buildPackages.go_1_17; | |||
}; | |||
buildGo118Package = callPackage ../development/go-packages/generic { | |||
buildGo118Package = darwin.apple_sdk_11_0.callPackage ../development/go-packages/generic { |
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.
or here
|
||
buildGo117Module = callPackage ../development/go-modules/generic { | ||
go = buildPackages.go_1_17; | ||
}; | ||
buildGo118Module = callPackage ../development/go-modules/generic { | ||
buildGo118Module = darwin.apple_sdk_11_0.callPackage ../development/go-modules/generic { |
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.
or here
The
Is this possible? I can see needing something like that in the future for DXVK when MoltenVK makes greater use of Metal 3 (and presumably can provide the missing extensions on macOS 13 or newer). |
Please lets do this in another PR. I don't want the go 1.18 PR to completely grow out of hand. There might also be failing tests or go.sum/vendoring files which need updating. |
Cherry-picked into #179622 |
Go 1.18 requires a newer SDK than the one we build from sources. As a
workaround we're making use of the SDK we're using for aarch64-darwin.
This means Go 1.18 will not work on any Darwin systems that don't have
forwards-compatible SDK versions with the particular package in
question. We might need to mark Go packages broken based on the macOS
version rather than just the platform and architecture.
Until we find a better solution, Go packages will need to make sure to
get all their (Darwin) system dependencies from the
apple_sdk_11_0
,this includes dependencies of build tools like
xcbuild
.For convenience
darwin.apple_sdk_11_0
has acallPackage
attributewhich provides the correct
stdenv
andxcbuild
attributes asarguments. This function can be expanded to substitute other necessary
arguments when they come up.
Description of changes
Use
darwin.apple_sdk_11_0.callPackage
forgo_1_18
,buildGo118Module
andbuildGo118Package
to insert a stdenv andxcbuild
based onapple_sdk_11_0
on Darwin.I've merged #179622 into this so I can run a Hydra evaluation for x86_64-darwin. I've kept this as a draft so I can either rebase after #179622 is merged or change the target branch to staging because of all the rebuilds.
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