mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
stdenv: stop passing crossSystem to local stages
The dispatcher now constructs local bootstrap stages directly, so their target is represented entirely by localSystem. Remove the redundant crossSystem arguments and equality assertions from each local stage implementation. Assisted-by: codex with gpt-5.6-sol-high
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
{
|
||||
lib,
|
||||
localSystem,
|
||||
crossSystem,
|
||||
config,
|
||||
overlays,
|
||||
# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
|
||||
@@ -22,8 +21,6 @@
|
||||
),
|
||||
}:
|
||||
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
inherit (localSystem) system;
|
||||
genericStdenv = import ../generic { defaultConfig = config; };
|
||||
|
||||
@@ -16,24 +16,14 @@
|
||||
}:
|
||||
|
||||
let
|
||||
commonArgs = {
|
||||
inherit
|
||||
lib
|
||||
localSystem
|
||||
crossSystem
|
||||
config
|
||||
overlays
|
||||
;
|
||||
};
|
||||
|
||||
useCrossStdenv = crossSystem != localSystem || crossOverlays != [ ];
|
||||
useCustomStdenv = !useCrossStdenv && (config.replaceStdenv or null) != null;
|
||||
|
||||
# Cross and custom stdenvs extend the local bootstrap stages. Keep
|
||||
# replaceStdenv out of those stages so it is applied only by the appended
|
||||
# custom stage; cross compilation uses replaceCrossStdenv instead.
|
||||
bootArgs = commonArgs // {
|
||||
crossSystem = if useCrossStdenv then localSystem else crossSystem;
|
||||
bootArgs = {
|
||||
inherit lib localSystem overlays;
|
||||
config =
|
||||
if useCrossStdenv || useCustomStdenv then removeAttrs config [ "replaceStdenv" ] else config;
|
||||
};
|
||||
@@ -69,7 +59,17 @@ let
|
||||
}
|
||||
.${localSystem.system} or stagesNative;
|
||||
|
||||
stagesCross = import ./cross (commonArgs // { inherit crossOverlays bootStages; });
|
||||
stagesCross = import ./cross {
|
||||
inherit
|
||||
lib
|
||||
localSystem
|
||||
crossSystem
|
||||
config
|
||||
overlays
|
||||
crossOverlays
|
||||
bootStages
|
||||
;
|
||||
};
|
||||
|
||||
replaceStdenvStage = vanillaPackages: {
|
||||
inherit config overlays;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
{
|
||||
lib,
|
||||
localSystem,
|
||||
crossSystem,
|
||||
config,
|
||||
overlays,
|
||||
bootstrapFiles ?
|
||||
@@ -18,7 +17,6 @@
|
||||
files,
|
||||
}:
|
||||
|
||||
assert crossSystem == localSystem;
|
||||
let
|
||||
genericStdenv = import ../generic { defaultConfig = config; };
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
{
|
||||
lib,
|
||||
localSystem,
|
||||
crossSystem,
|
||||
config,
|
||||
overlays,
|
||||
bootstrapFiles ?
|
||||
@@ -116,8 +115,6 @@
|
||||
(config.replaceBootstrapFiles or lib.id) files,
|
||||
}:
|
||||
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
genericStdenv = import ../generic { defaultConfig = config; };
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
{
|
||||
lib,
|
||||
localSystem,
|
||||
crossSystem,
|
||||
config,
|
||||
overlays,
|
||||
}:
|
||||
|
||||
assert crossSystem == localSystem;
|
||||
|
||||
let
|
||||
genericStdenv = import ../generic { defaultConfig = config; };
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
{
|
||||
lib,
|
||||
localSystem,
|
||||
crossSystem,
|
||||
config,
|
||||
overlays,
|
||||
bootStages,
|
||||
}:
|
||||
|
||||
assert crossSystem == localSystem;
|
||||
let
|
||||
genericStdenv = import ../generic { defaultConfig = config; };
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user