Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuilding NixOS on Raspberry Pi 4 fails after commit 4014fb6 #155925

Closed
superherointj opened this issue Jan 20, 2022 · 4 comments
Closed

Rebuilding NixOS on Raspberry Pi 4 fails after commit 4014fb6 #155925

superherointj opened this issue Jan 20, 2022 · 4 comments
Labels
0.kind: bug Something is broken

Comments

@superherointj
Copy link
Contributor

superherointj commented Jan 20, 2022

Rebuilding NixOS on Raspberry Pi 4 fails after commit: 4014fb6 (PR #151082)

Errors as:

/nix/store/l3lj95gg3fx9amqcywv0qfsabs2nw4nj-raspberrypi-builder.sh: illegal option -- g
usage: /nix/store/l3lj95gg3fx9amqcywv0qfsabs2nw4nj-raspberrypi-builder.sh -c <path-to-default-configuration> [-d <boot-dir>]
warning: error(s) occurred while switching to the new configuration

My configuration.nix has:

boot.loader.raspberryPi = {
  enable = true;
  version = 4;
  firmwareConfig = ''
    dtparam=sd_poll_once=on
    dtoverlay=vc4_fkms_v3d,cma-256
  '';
};

boot.loader.generic-extlinux-compatible.enable = true;

system.stateVersion = "21.11";

Question:

  1. Does it affect other Raspberry Pi 4 users (when upgrading past PR nixos: turn vmWithBootLoader into option (nixos-rebuild build-vm) #151082)?

@roberth @ncfavier @samueldr

@superherointj superherointj added the 0.kind: bug Something is broken label Jan 20, 2022
@superherointj superherointj changed the title Rebuilding NixOS on Raspberry Pi 4 fails after issue #151082 Rebuilding NixOS on Raspberry Pi 4 fails after PR #151082 Jan 20, 2022
@superherointj superherointj changed the title Rebuilding NixOS on Raspberry Pi 4 fails after PR #151082 Rebuilding NixOS on Raspberry Pi 4 fails after commit: 4014fb6 Jan 20, 2022
@superherointj superherointj changed the title Rebuilding NixOS on Raspberry Pi 4 fails after commit: 4014fb6 Rebuilding NixOS on Raspberry Pi 4 fails after commit 4014fb6 Jan 20, 2022
@rhoriguchi
Copy link
Contributor

Might be able to help: @samueldr @tkerber

@ncfavier
Copy link
Member

ncfavier commented Jan 20, 2022

I think the problem is that the new type causes multiple definitions to be merged (concatenated as strings), and since you're probably generating an SD image your config has boot.loader.generic-extlinux-compatible.enable = true which results in two definitions for system.build.installBootLoader, one from raspberrypi.nix and one from generic-extlinux-compatible (notice the -g there in builderArgs), so the resulting builder is nonsense.

Now I wonder why this succeeded before this commit. EDIT: it's because type.attrs merges with //, and in this case the extlinux definition was winning.

@superherointj
Copy link
Contributor Author

I think the problem is that the new type causes multiple definitions to be merged (concatenated as strings), and since you're probably generating an SD image your config has boot.loader.generic-extlinux-compatible.enable = true which results in two definitions for system.build.installBootLoader, one from raspberrypi.nix and one from generic-extlinux-compatible (notice the -g there in builderArgs), so the resulting builder is nonsense.

Now I wonder why this succeeded before this commit.

Correct, my configuration.nix has:
boot.loader.generic-extlinux-compatible.enable = true

superherointj referenced this issue Jan 20, 2022
Legacy types.attrs has really bad merging behavior and does not
support priorities.

f build
@superherointj
Copy link
Contributor Author

superherointj commented Jan 20, 2022

As @ncfavier correctly pointed out: The configs were clashing and that was causing the issue. After fixing the configuration.nix (by removing the raspberryPi specific config) I'm now able to upgrade past commit 4014fb6 to unstable. So I'm closing the issue.

Thanks @samueldr @ncfavier for the support in solving this issue.

ncfavier added a commit to ncfavier/nixpkgs that referenced this issue Jan 20, 2022
`unspecified` will happily concatenate strings together from two
unrelated modules, causing spurious errors (see NixOS#155925).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants