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:
Aliaksandr
2026-07-19 00:11:51 +03:00
parent bbb150a331
commit 2dd1349006
6 changed files with 13 additions and 26 deletions

View File

@@ -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; };

View File

@@ -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;

View File

@@ -3,7 +3,6 @@
{
lib,
localSystem,
crossSystem,
config,
overlays,
bootstrapFiles ?
@@ -18,7 +17,6 @@
files,
}:
assert crossSystem == localSystem;
let
genericStdenv = import ../generic { defaultConfig = config; };

View File

@@ -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; };

View File

@@ -1,13 +1,10 @@
{
lib,
localSystem,
crossSystem,
config,
overlays,
}:
assert crossSystem == localSystem;
let
genericStdenv = import ../generic { defaultConfig = config; };

View File

@@ -1,13 +1,11 @@
{
lib,
localSystem,
crossSystem,
config,
overlays,
bootStages,
}:
assert crossSystem == localSystem;
let
genericStdenv = import ../generic { defaultConfig = config; };
in