nixos/nixpkgs: fix determination for cross-compiled nixos system#292487
nixos/nixpkgs: fix determination for cross-compiled nixos system#292487roberth merged 1 commit intoNixOS:masterfrom
Conversation
|
Where did this isCross come from? 😅. It's way too vague like this... What about other cross types, like Canadian cross? |
|
We have three solutions to this problem
2 is in progress IIRC, but is a slow deprecation. You're doing 3. 1 is a bit more effective though, because it fixes all comparisons of - apply = lib.systems.elaborate;
+ apply = inputBuildPlatform:
+ let elaborated = lib.systems.elaborate inputBuildPlatform;
+ in if lib.systems.equals elaborated cfg.hostPlatform
+ then cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
+ else elaborated;(Perhaps relevant are also #237512, #254763 and related PRs/issues, if you haven't seen them) That all said, all other modules shouldn't read from anything other than the |
From me. I don't think it is vague.
Nixpkgs is not a compiler, so Canadian cross does not apply to it. Its configuration only has two platforms: build and host; no target. |
cf798cd to
7395704
Compare
|
@roberth that makes sense, and is also more forgiving to potential usage of |
Since the output of `lib.systems.elaborate` contains functions, an equality check with `==` does not suffice, `lib.systems.equals` should be used instead.
7395704 to
3794246
Compare
roberth
left a comment
There was a problem hiding this comment.
Looks good and thank you for adding a test case 👍
Description of changes
Since the output of
lib.systems.elaboratecontains functions, an equality check with==does not suffice,lib.systems.equalsshould be used instead.Fixes #278001
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.