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

Impossible to easily upgrade NixOS from <=17.09 to 18.09 #46387

Open
Infinisil opened this Issue Sep 8, 2018 · 10 comments

Comments

Projects
None yet
7 participants
@Infinisil
Copy link
Contributor

Infinisil commented Sep 8, 2018

Issue description

Since 18.09 now forces people to update their Nix version to 2.0 (see #45779), only people running a 18.03 system will actually be able to smoothly upgrade with the default update procedure (upgrade channel, nixos-rebuild). Reason being that in versions <=17.09 the default Nix daemon version is <2.0, which means that even if you install a Nix 2.0 client, it won't succeed due to the daemon/client mismatch (see #42319).

Potential solutions

  • Improve upgrade instructions to mention that people need to do a 2-step upgrade process through 18.03
  • (partial solution) Don't force people on Nix 2.0 until a later release, such that this will only be a problem when upgrading from <=17.09 to 19.03

Preferably both of those

Workarounds

  • Upgrade via 18.03
  • Boot into the installer and call nixos-install
  • Set nix.package = <nix 2> before upgrading

In my opinion we should revert the 2.0 forcing anyways, there's just too many problems with 2.0 yet to be addressed. There's been already 2 people in IRC with super annoying Nix upgrade process bugs since the bump 2 weeks ago.

Ping @samueldr @vcunat @grahamc @lheckemann @symphorien @ElvishJerricco

@lheckemann

This comment has been minimized.

Copy link
Member

lheckemann commented Sep 8, 2018

IMHO:

Boot into the installer and call nixos-install

is the right solution. Low fuss and high reliability.

@vcunat vcunat added this to the 18.09 milestone Sep 8, 2018

@LnL7

This comment has been minimized.

Copy link
Member

LnL7 commented Sep 8, 2018

Doesn't nixos-rebuild build nix first and use that to evaluate/build the rest of the system for this exact reason?

EDIT:

@Infinisil

This comment has been minimized.

Copy link
Contributor

Infinisil commented Sep 8, 2018

@LnL7 Not sure how that's supposed to work, because importing nixpkgs will fail in any case with a Nix version <2.0, because of the check in <nixpkgs/default.nix>. nixos-rebuild should have the same problem.

@vcunat

This comment has been minimized.

Copy link
Member

vcunat commented Sep 8, 2018

Now, the build-time closure of nix itself probably won't use placeholders yet, so the abortion itself would be the only blocker (as only new nix gets built and then it's used for further evaluation), but I can't see how to easily enforce this [...]

@LnL7

This comment has been minimized.

Copy link
Member

LnL7 commented Sep 8, 2018

Yeah, it works slightly differently then I expected. I thought only nix itself would rebuild or substitute using the fallback paths.

@vcunat

This comment has been minimized.

Copy link
Member

vcunat commented Sep 8, 2018

If fallback was to be used/preferred, you wouldn't be able to use a custom nix for your nixos (for the OS evaluation step at least).

@LnL7

This comment has been minimized.

Copy link
Member

LnL7 commented Sep 8, 2018

Yes, the fallback paths should be used as a fallback. 😄

@srhb

This comment has been minimized.

Copy link
Contributor

srhb commented Sep 9, 2018

As far as I recall, it is also not possible to upgrade to 18.03 from 17.03 without going though 17.09 first, since the Nix 1.11 in 17.03 is too old to evaluate 18.03, so this isn't a completely unusual situation.

I do agree that it's nice to facilitate a good upgrade path for people who still use unsupported versions of NixOS.

@ElvishJerricco

This comment has been minimized.

Copy link
Contributor

ElvishJerricco commented Sep 9, 2018

I just booted up a 17.03 VM and ran:

$ nixos-rebuild boot -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.03.tar.gz

And it worked just fine. I believe it evaluated the nix package from the 18.03 nixpkgs and used that to evaluate the system configuration.

@Mic92

This comment has been minimized.

Copy link
Contributor

Mic92 commented Sep 16, 2018

Maybe we could allow to just evaluate the nix package from nixpkgs and have a test that we do not use nix 2.0 features for its dependencies yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment