From cadca751c4739536db36adccbeaf7fc7fa9775a2 Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Sun, 17 May 2026 02:14:48 +0800 Subject: [PATCH] lib.systems.equals: fix euqality on re-elaborated platform --- lib/systems/default.nix | 5 +++-- lib/tests/systems.nix | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index f2be7c2c5094..a5db767730a9 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -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. diff --git a/lib/tests/systems.nix b/lib/tests/systems.nix index 2cc8f7aa607e..3feef87d97c0 100644 --- a/lib/tests/systems.nix +++ b/lib/tests/systems.nix @@ -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