From abae62cff79452eeb28898393848a1955e81ca21 Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Mon, 28 Sep 2026 07:48:36 -0400 Subject: [PATCH] stdenv: Use lib.systems.equals to compare systems I made an experimental version of nix that made all functions compare as not equal (even if they have the same pointer) to sniff out bits of nixpkgs that still depend on comparing functions. This commit stamps out a few of those in pkgs/stdenv, which are necessary to allow that experimental version to eval, eg, pkgs.hello (otherwise bootstrap infinite recurses). --- pkgs/stdenv/booter.nix | 8 ++++---- pkgs/stdenv/default.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/stdenv/booter.nix b/pkgs/stdenv/booter.nix index 934e7b87d14d..052e01834986 100644 --- a/pkgs/stdenv/booter.nix +++ b/pkgs/stdenv/booter.nix @@ -118,16 +118,16 @@ let pkgsBuildBuild = prevStage.buildPackages; pkgsBuildHost = prevStage; pkgsBuildTarget = - if args.stdenv.targetPlatform == args.stdenv.hostPlatform then + if lib.systems.equals args.stdenv.targetPlatform args.stdenv.hostPlatform then pkgsBuildHost else - assert args.stdenv.hostPlatform == args.stdenv.buildPlatform; + assert lib.systems.equals args.stdenv.hostPlatform args.stdenv.buildPlatform; thisStage; pkgsHostHost = - if args.stdenv.hostPlatform == args.stdenv.targetPlatform then + if lib.systems.equals args.stdenv.hostPlatform args.stdenv.targetPlatform then thisStage else - assert args.stdenv.buildPlatform == args.stdenv.hostPlatform; + assert lib.systems.equals args.stdenv.buildPlatform args.stdenv.hostPlatform; pkgsBuildHost; pkgsTargetTarget = nextStage; }; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 56ae4538ea6a..724e3beb99b9 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -16,7 +16,7 @@ }: let - useCrossStdenv = crossSystem != localSystem || crossOverlays != [ ]; + useCrossStdenv = !(lib.systems.equals crossSystem localSystem) || crossOverlays != [ ]; useCustomStdenv = !useCrossStdenv && (config.replaceStdenv or null) != null; # Cross and custom stdenvs extend the local bootstrap stages. Keep