lib.systems.equals: fix euqality on re-elaborated platform

This commit is contained in:
Mix
2026-05-17 02:14:48 +08:00
parent a438d11115
commit cadca751c4
2 changed files with 19 additions and 2 deletions

View File

@@ -85,11 +85,12 @@ let
let
allArgs = systemToAttrs systemOrArgs;
# Those two will always be derived from "config", if given, so they should NOT
# be overridden further down with "// args".
# These attributes are derived from other inputs, so they should NOT be
# overridden further down with "// args".
args = removeAttrs allArgs [
"parsed"
"system"
"_withoutFunctions"
];
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.

View File

@@ -266,6 +266,22 @@ lib.runTests (
}).parsed.cpu.arch;
expected = "i686";
};
test_equals_reelaborate_overridden_platform = {
expr =
let
base = lib.systems.elaborate "x86_64-linux";
in
lib.systems.equals base (
lib.systems.elaborate (
base
// {
useLLVM = true;
linker = "lld";
}
)
);
expected = false;
};
}
// {
# equals.functionNames must list exactly the function-valued attrs of an