Skip to content

Conversation

misuzu
Copy link
Contributor

@misuzu misuzu commented Jan 30, 2023

Description of changes

Fix nixpkgs evaluation error when using nixpkgs-review on armv7l-linux:

$ nix-env --option system armv7l-linux -f /home/misuzu/nixpkgs -qaP --xml --out-path --show-trace --no-allow-import-from-derivation > /dev/null
error: attribute 'armv7l-linux' missing

       at /home/misuzu/nixpkgs/pkgs/tools/misc/grub/pvgrub_image/default.nix:24:24:

           23|     # if we include it.
           24|     grub-mkimage -O "${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen" -c grub-bootstrap.cfg \
             |                        ^
           25|       -m memdisk.tar -o "grub-${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen.bin" \

       … while evaluating the attribute 'buildCommand' of the derivation 'pvgrub-image'

       at /home/misuzu/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while querying the derivation named 'pvgrub-image'

Copied from

efiSystemsBuild = {

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • armv7l-linux
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jan 30, 2023
@Artturin Artturin merged commit 5a1703f into NixOS:master Jan 30, 2023
@misuzu misuzu deleted the grub2_pvgrub_image_eval branch January 30, 2023 18:18
@hehongbo
Copy link
Contributor

hehongbo commented Aug 6, 2025

It's not because of a lack of supported platforms declaration, it's because meta.platforms was declared incorrectly in the first place. While this fixed the evaluation error on ARM and RISC-V, we should make it clear that only two x86 platforms are supported in PvGrub, and simply adding unsupported platforms to fix evaluation errors is misleading.

See #374753, and my comment underneath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants