diff options
| author | Kamil Zaripov <kamil@zaripov.net> | 2025-08-16 22:10:30 +0300 |
|---|---|---|
| committer | Kamil Zaripov <kamil@zaripov.net> | 2025-08-16 22:26:25 +0300 |
| commit | 4f2f8faa7f7d3cba5c4eccf6077cef2235f0071a (patch) | |
| tree | 608982e3bb3f98c75b6d680b4b52c8a71c5b578a /pkgs/development/python-modules/python-openstackclient | |
| parent | 1f5f5ac80bc00b25a02a8136bb6bd79106b413ce (diff) | |
check-meta: Clarify error message about unsupported platform
Right now if you are specifying supported platforms using meta.platforms
you can get a bit misleading error message:
$ nix-build default.nix
error:
… in the condition of the assert statement
at /nix/store/53pzmaza73pl8q2yl1q62h7ncx21nxc1-source/lib/customisation.nix:419:9:
418| drvPath =
419| assert condition;
| ^
420| drv.drvPath;
… while evaluating the attribute 'handled'
at /nix/store/53pzmaza73pl8q2yl1q62h7ncx21nxc1-source/pkgs/stdenv/generic/check-meta.nix:643:9:
642| # or, alternatively, just output a warning message.
643| handled = (
| ^
644| if valid == "yes" then
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Package ‘test’ in /home/kamil/code/test/default.nix:3 is not available on the requested hostPlatform:
hostPlatform.config = "aarch64-none-elf"
package.meta.platforms = [
"aarch64-none-elf"
]
package.meta.badPlatforms = [ ]
, refusing to evaluate.
a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.
It is not clear why this derivation cannot be built for
"aarch64-none-elf" target since error message list this triplet in
package.meta.platforms right below hostPlatform.config. The issue is that
package.meta.platforms is checked against hostPlatform.system field, not
hostPlatform.config field:
https://github.com/NixOS/nixpkgs/blob/b134951a4c9f3c995fd7be05f3243f8ecd65d798/lib/meta.nix#L103
And in this case hostPlatform.system is "aarch64-none" while
hostPlatform.config is "aarch64-none-efi".
I think that it would be better to print hostPlatform.system in error
message.
Diffstat (limited to 'pkgs/development/python-modules/python-openstackclient')
0 files changed, 0 insertions, 0 deletions
