go: fix cross-compilation

Because:

* `go-bootstrap` is a native build input of go, so it needs to have
  an offset of -1. Otherwise, e.g. when building a go cross-compiler,
  it will try to make go-bootstrap a cross-compiler too.
* have to specify `buildPackages` for the `stdenv` override, otherwise
  `buildPackages.stdenv` will be the same as `pkgs.gcc8Stdenv`.
This commit is contained in:
Ryan Burns 2021-02-17 17:52:52 -08:00 committed by zowoq
parent d8da3220c0
commit 9511f29f40
5 changed files with 9 additions and 9 deletions

View File

@ -13,7 +13,7 @@ let
version = "1.14.15";
go_bootstrap = callPackage ./bootstrap.nix { };
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out

View File

@ -13,7 +13,7 @@ let
version = "1.15.8";
go_bootstrap = callPackage ./bootstrap.nix { };
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out

View File

@ -13,7 +13,7 @@ let
version = "1.16";
go_bootstrap = callPackage ./bootstrap.nix { };
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out

View File

@ -11,7 +11,7 @@ let
inherit (lib) optionals optionalString;
go_bootstrap = callPackage ./bootstrap.nix { };
go_bootstrap = buildPackages.callPackage ./bootstrap.nix { };
goBootstrap = runCommand "go-bootstrap" {} ''
mkdir $out

View File

@ -284,7 +284,7 @@ in
grsync = callPackage ../applications/misc/grsync { };
dockerTools = callPackage ../build-support/docker {
go = go_1_15;
go = buildPackages.go_1_15;
writePython3 = buildPackages.writers.writePython3;
};
@ -10208,28 +10208,28 @@ in
inherit (darwin.apple_sdk.frameworks) Security Foundation;
} // lib.optionalAttrs (stdenv.cc.isGNU && stdenv.isAarch64) {
stdenv = gcc8Stdenv;
buildPackages = buildPackages // { stdenv = gcc8Stdenv; };
buildPackages = buildPackages // { stdenv = buildPackages.gcc8Stdenv; };
});
go_1_15 = callPackage ../development/compilers/go/1.15.nix ({
inherit (darwin.apple_sdk.frameworks) Security Foundation;
} // lib.optionalAttrs (stdenv.cc.isGNU && stdenv.isAarch64) {
stdenv = gcc8Stdenv;
buildPackages = buildPackages // { stdenv = gcc8Stdenv; };
buildPackages = buildPackages // { stdenv = buildPackages.gcc8Stdenv; };
});
go_1_16 = callPackage ../development/compilers/go/1.16.nix ({
inherit (darwin.apple_sdk.frameworks) Security Foundation;
} // lib.optionalAttrs (stdenv.cc.isGNU && stdenv.isAarch64) {
stdenv = gcc8Stdenv;
buildPackages = buildPackages // { stdenv = gcc8Stdenv; };
buildPackages = buildPackages // { stdenv = buildPackages.gcc8Stdenv; };
});
go_2-dev = callPackage ../development/compilers/go/2-dev.nix ({
inherit (darwin.apple_sdk.frameworks) Security Foundation;
} // lib.optionalAttrs (stdenv.cc.isGNU && stdenv.isAarch64) {
stdenv = gcc8Stdenv;
buildPackages = buildPackages // { stdenv = gcc8Stdenv; };
buildPackages = buildPackages // { stdenv = buildPackages.gcc8Stdenv; };
});
go = go_1_16;