Skip to content

Commit

Permalink
stdenv: fix crossSystem localSystem comparison
Browse files Browse the repository at this point in the history
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»
```
  • Loading branch information
Artturin committed Jun 15, 2023
1 parent 5ff6f51 commit e5e5fd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgs/stdenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
in files
}:

assert crossSystem == localSystem;
assert lib.systems.equals crossSystem localSystem;

let
inherit (localSystem) system;
Expand Down

0 comments on commit e5e5fd1

Please sign in to comment.