stdenv: generalise showPlatforms#222792
Conversation
34f0fb7 to
89df60b
Compare
89df60b to
b46c97e
Compare
|
Result of |
ghost
left a comment
There was a problem hiding this comment.
This is still wrong.
$ NIXPKGS_ALLOW_BROKEN=1 nix-instantiate . -A pkgsStatic.systemd
error: Package ‘systemd-252.5’ in /git/nixpkgs/pkgs/os-specific/linux/systemd/default.nix:724 is only supported on `aarch64-linux armv5tel-linux armv6l-linux armv7a-linux armv7l-linux i686-linux m68k-linux microblaze-linux microblazeel-linux mipsel-linux mips64el-linux powerpc64-linux powerpc64le-linux riscv32-linux riscv64-linux s390-linux s390x-linux x86_64-linux` but not on requested ‘x86_64-linux’, refusing to evaluate.
👎
(The NIXPKGS_ALLOW_BROKEN=1 is only because the simplest counterexample, systemd, declares itself to be meta.broken on the platforms it doesn't support -- which is sort of going overboard).
Note the bolded portions:
error: Package ‘systemd-252.5’ in /git/nixpkgs/pkgs/os-specific/linux/systemd/default.nix:724 is only supported on aarch64-linux armv5tel-linux armv6l-linux armv7a-linux armv7l-linux i686-linux m68k-linux microblaze-linux microblazeel-linux mipsel-linux mips64el-linux powerpc64-linux powerpc64le-linux riscv32-linux riscv64-linux s390-linux s390x-linux x86_64-linux but not on requested x86_64-linux, refusing to evaluate.
The error message is telling the user that this package is only supported on x86_64-linux, so it's unsupported on x86_64-linux.
You cannot just lib.filter lib.systems.all and expect the result to explain the problem to the user
|
I'm not the one introducing the output of the platforms in the error message. The pull requests I made are to fix obvious problems, like breaking nixpkgs-review. There are certainly edge cases that I didn't detect, and I clearly mentioned one of them in the first PR. @amjoseph-nixpkgs Maybe you'll want to fix this for static and cross builds, but if not, I'd suggest completely revert the commits beginning from @SuperSandro2000's. |
|
Proper fix: #222852 |
See #222792 (review) You can't just `lib.filter _ lib.systems.all` -- that throws away important information, leading to nixpkgs disagreeing with itself like this: ``` $ NIXPKGS_ALLOW_BROKEN=1 nix-instantiate . -A pkgsStatic.systemd error: Package ‘systemd-252.5’ in ... is only supported on ... x86_64-linux but not on requested x86_64-linux, refusing to evaluate. ``` After: ``` $ NIXPKGS_ALLOW_BROKEN=1 nix-instantiate . -A pkgsStatic.systemd error: Package ‘systemd-252.5’ in ... is not available on the requested hostPlatform: hostPlatform.config = "x86_64-unknown-linux-musl" package.meta.platforms = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "m68k-linux" "microblaze-linux" "microblazeel-linux" "mipsel-linux" "mips64el-linux" "powerpc64-linux" "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux" ] package.meta.badPlatforms = [ { isStatic = true; parsed = { }; } ] , refusing to evaluate. ```
I tested this with the gcc arches added to a machine when gcc.arch/march are set and there it yielded useful results. 😅 |
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)