NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.14k stars 14.17k forks source link

nixos-rebuild will not switch to new configuration (possibly gummiboot-related) #14902

Closed NeQuissimus closed 8 years ago

NeQuissimus commented 8 years ago

Issue description

I am trying to nixos-rebuild switch (it does not matter whether I do it with or without -I nixpkgs=~/dev/nixpkgs; where that points at the latest master; I have also run with --upgrade to pull the latest channel updates). I keep seeing the following, complaining about something with gummiboot:

Traceback (most recent call last):
  File "/nix/store/jppdlvff9ldhxm6wcq2cjsx1094hsg9m-gummiboot-builder.py", line 112, in <module>
    gens = get_generations("system")
  File "/nix/store/jppdlvff9ldhxm6wcq2cjsx1094hsg9m-gummiboot-builder.py", line 67, in get_generations
    "--option", "build-users-group", ""
  File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
warning: error(s) occurred while switching to the new configuration

The gummiboot-builder.py seems to issue nix-env --list-generations --option build-users-group "", which when run by hand, results in the following for me:

  16   2016-04-15 09:27:26   (current)

Steps to reproduce

nixos-rebuild switch

Technical details

dezgeg commented 8 years ago

Probably this:

diff --git a/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix b/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix
index 6c201eb..69ad2c6 100644
--- a/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix
+++ b/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix
@@ -14,7 +14,7 @@ let

     inherit (pkgs) python gummiboot;

-    nix = config.nix.package;
+    nix = config.nix.package.out;

     timeout = if cfg.timeout != null then cfg.timeout else "";
domenkozar commented 8 years ago

This is what we get for removing UEFI tests :(

domenkozar commented 8 years ago

@aszlig another reason for ${config.nix.package.out => bin/nix-env}

domenkozar commented 8 years ago

See 92837f2dbf2bf3691f3f82548ed29ce6cd79155d

dezgeg commented 8 years ago

Well, #14766 also helps as a stop-gap solution (requiring no changes to the Nix language).

dezgeg commented 8 years ago

BTW we do seem to have UEFI boot tests which do seem to work (well pretty much every test is now broken due to dbus upgrade): http://hydra.nixos.org/build/34909292, though they aren't marked as release-critical.

domenkozar commented 8 years ago

I've made the boot tests a requirement for a release.

dezgeg commented 8 years ago

Great! I already started to work on the UEFI test (without noticing the old one), but got sidetracked by the dbus thing... https://github.com/dezgeg/nixpkgs/commit/348947fc41b7c46310c4389602530f2c0661b6db

NeQuissimus commented 8 years ago

Adding .out to the nix package definition does seem to fix the issue. The fact that nix-daemon will not start has to do with the dbus issues, I assume?

dezgeg commented 8 years ago

Probably yes, just fetch latest master where the dbus update is reverted.

vcunat commented 8 years ago

It's not in master but staging.

dezgeg commented 8 years ago

Ok so closer look tells that this only happens with e.g. nix.package = pkgs.nixUnstable;. Fix is at #14953.

bobvanderlinden commented 8 years ago

@domenkozar Just to note, those boot tests are only for booting ISO using UEFI from CD-rom and USB, not for actual 'normal' harddisks: separate boot partition, GPT and all that. The ISO also has custom gummiboot configuration, so generating gummiboot configuration is not covered by those tests. I've made #14956 to continue that conversation separately.

NeQuissimus commented 8 years ago

So after rebuilding against staging, I am still getting the error with nix-daemon. The service file simply has no ExecStart or ExecStop and systemd can therefore not run anything. Is that an issue along the same lines as this or should I open a new one for it?

dezgeg commented 8 years ago

Did you try the full fix (#14953)?

NeQuissimus commented 8 years ago

Yes, it seems fine now. Closing this one, since we seem to have open issues for all the things.