diff --git a/pkgs/test/top-level/default.nix b/pkgs/test/top-level/default.nix index fcfb185bbcd6c..0c75468f70b53 100644 --- a/pkgs/test/top-level/default.nix +++ b/pkgs/test/top-level/default.nix @@ -118,8 +118,8 @@ lib.recurseIntoAttrs { # assert isComposable "pkgsZig"; # TODO: attribute 'abi' missing # assert isComposable "pkgsMusl"; + assert isComposable "pkgsStatic"; # TODO: fails - # assert isComposable "pkgsStatic"; # assert isComposable "pkgsi686Linux"; # Special cases regarding buildPlatform vs hostPlatform diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 526cc5769f0a5..f535527b2f2e8 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -44,7 +44,7 @@ let # Rename the function arguments config0 = config; - crossSystem0 = crossSystem; + crossSystem0 = if crossSystem == null then localSystem else crossSystem; in let lib = import ../../lib; @@ -74,7 +74,7 @@ in let # inferred from the system double in `localSystem`. crossSystem = let system = lib.systems.elaborate crossSystem0; in - if crossSystem0 == null || lib.systems.equals system localSystem + if lib.systems.equals system localSystem then localSystem else system; @@ -125,7 +125,7 @@ in let args // lib.optionalAttrs (newArgs ? "localSystem") { localSystem = newArgs.localSystem; } // lib.optionalAttrs (newArgs ? "crossSystem") { - crossSystem = newArgs.crossSystem; + crossSystem = lib.systems.asAttrs crossSystem0 // newArgs.crossSystem; } // lib.optionalAttrs (newArgs ? "overlays") { overlays = overlays ++ newArgs.overlays; }); diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 7d0597aed585c..d4b83d2e472f5 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -219,7 +219,7 @@ let # Bootstrap a cross stdenv using the LLVM toolchain. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. - crossSystem = stdenv.targetPlatform // { + crossSystem = { useLLVM = true; linker = "lld"; }; @@ -229,7 +229,7 @@ let # Bootstrap a cross stdenv using the Aro C compiler. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. - crossSystem = stdenv.hostPlatform // { + crossSystem = { useArocc = true; linker = "lld"; }; @@ -239,7 +239,7 @@ let # Bootstrap a cross stdenv using the Zig toolchain. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. - crossSystem = stdenv.hostPlatform // { + crossSystem = { useZig = true; linker = "lld"; }; @@ -290,13 +290,10 @@ let pkgsStatic = createPackageSet "pkgsStatic" ({ crossSystem = { isStatic = true; - config = lib.systems.parse.tripleFromSystem ( - if stdenv.hostPlatform.isLinux - then makeMuslParsedPlatform stdenv.hostPlatform.parsed - else stdenv.hostPlatform.parsed - ); - gcc = lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") { abi = "elfv2"; } // - stdenv.hostPlatform.gcc or {}; + } // lib.optionalAttrs stdenv.hostPlatform.isLinux { + config = lib.systems.parse.tripleFromSystem (makeMuslParsedPlatform stdenv.hostPlatform.parsed); + } // lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") { + gcc = { abi = "elfv2"; } // stdenv.hostPlatform.gcc or {}; }; });