Reference to undefined variable in systemd-boot #153362
Labels
0.kind: bug
Something is broken
2.status: stale
https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
6.topic: systemd
Describe the bug
I believe there's an error in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py#L284:
profile
is referenced but is not in scope. This causednixos-rebuild switch
to fail for me.Steps To Reproduce
I don't have clear reproduction steps :( however, I can tell you what happened:
I was installing the
esy
package from the https://github.com/anmonteiro/nix-overlays flake into my NixOS system flake. Thenixos-rebuild switch
failed because one of the dependency packages failed to build.Going forward, all calls to
nixos-rebuild switch
failed with an error coming from the above systemd-boot script. I looked at the script, noticed the missing variable, remounted/nix/store
as read/write, removed the reference to the missing variable, andnixos-rebuild switch
works again. However, I still print the error caught:It seems that this was the root error, which bubbled up and was caught by the error handler linked, only there's a bug in the handler code.
I don't know what caused my initial error - the first package to fail to build was https://gitlab.com/nomadic-labs/lwt-exit and I'm guessing there is either some unexpected non-determinism in the test or something peculiar about my system. I'm not sure how that broke my whole NixOS system, but I'm guessing there was some necessary cleanup that was prevented but the bug I've described.
Expected behavior
The script should keep going as intended. Printing out the generation number (which is in scope) would be a helpful clue from which to track down the error.
Screenshots
N/A
Additional context
My system flake is here https://github.com/d4hines/beth/tree/nixos. Not much has changed between the occurrence of the error and now.
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.(Obviously there's a problem with this output. I hypothesize the reason NIX_PATH is missing has something to do with installing NixOS from a flake via the method described in https://nixos.org/manual/nixos/stable/index.html#sec-installing-from-other-distro. This may or may not be related to the initial cause of my error, but regardless, I think I've still found a real bug in the above python systemd-boot script).
The text was updated successfully, but these errors were encountered: