From e5e5fd10b798d292ab981385d1e4c6cbb3699f53 Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 13 Jun 2023 00:17:16 +0300 Subject: [PATCH] stdenv: fix crossSystem localSystem comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this appears to fix the following issue for some reason ``` nix-repl> (import ./. { localSystem.system = "x86_64-linux"; crossSystem.system = "x86_64-linux"; }).bash «derivation /nix/store/5lz9p8xhf89kb1c1kk6jxrzskaiygnlh-bash-5.2-p15.drv» nix-repl> (import ./. { localSystem.system = "x86_64-linux"; crossSystem = "x86_64-linux"; }).bash «derivation /nix/store/1whiq03rsfrmch2ds3jhyqjaczfz97lb-bash-5.2-p15-x86_64-unknown-linux-gnu.drv» ``` fixed ``` nix-repl> (import ./. { localSystem.system = "x86_64-linux"; crossSystem = "x86_64-linux"; }).bash «derivation /nix/store/5lz9p8xhf89kb1c1kk6jxrzskaiygnlh-bash-5.2-p15.drv» ``` --- pkgs/stdenv/default.nix | 2 +- pkgs/stdenv/linux/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 7a2ad665e09d7d2..bc61a2ab174d9af 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -36,7 +36,7 @@ let # Select the appropriate stages for the platform `system'. in - if crossSystem != localSystem || crossOverlays != [] then stagesCross + if !lib.systems.equals crossSystem localSystem || crossOverlays != [] then stagesCross else if config ? replaceStdenv then stagesCustom else if localSystem.isLinux then stagesLinux else if localSystem.isDarwin then stagesDarwin diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 9cfe21e3640d48e..fb0bc94ad4ca354 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -95,7 +95,7 @@ in files }: -assert crossSystem == localSystem; +assert lib.systems.equals crossSystem localSystem; let inherit (localSystem) system;