Skip to content

Commit

Permalink
go_1_18: Use apple_sdk_11_0.callPackage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
toonn authored and SuperSandro2000 committed Jul 15, 2022
1 parent 491ce92 commit 00336e2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13402,8 +13402,9 @@ with pkgs;
buildPackages = buildPackages // { stdenv = buildPackages.gcc8Stdenv; };
});

go_1_18 = callPackage ../development/compilers/go/1.18.nix {
inherit (darwin.apple_sdk.frameworks) Security Foundation;
# go 1.18 requires a newer Apple SDK to be build. See commit message for more details.
go_1_18 = darwin.apple_sdk_11_0.callPackage ../development/compilers/go/1.18.nix {
inherit (darwin.apple_sdk_11_0.frameworks) Security Foundation;
};

go = go_1_18;
Expand Down Expand Up @@ -21750,7 +21751,9 @@ with pkgs;
buildGo117Package = callPackage ../development/go-packages/generic {
go = buildPackages.go_1_17;
};
buildGo118Package = callPackage ../development/go-packages/generic {

# go 1.18 requires a newer Apple SDK to be build. See commit message for more details.
buildGo118Package = darwin.apple_sdk_11_0.callPackage ../development/go-packages/generic {
go = buildPackages.go_1_18;
};

Expand All @@ -21759,7 +21762,9 @@ with pkgs;
buildGo117Module = callPackage ../development/go-modules/generic {
go = buildPackages.go_1_17;
};
buildGo118Module = callPackage ../development/go-modules/generic {

# go 1.18 requires a newer Apple SDK to be build. See commit message for more details.
buildGo118Module = darwin.apple_sdk_11_0.callPackage ../development/go-modules/generic {
go = buildPackages.go_1_18;
};

Expand Down

0 comments on commit 00336e2

Please sign in to comment.