Skip to content

Commit

Permalink
Revert "nixUnstable: rename to nix-unstable"
Browse files Browse the repository at this point in the history
This commit effectively makes it impossible to upgrade to nixUnstable
with nix-env without mucking about with priorities, as you can't
uninstall the old nix transactionally with the new nix and if you
uninstall the old one first you no longer have nix at your disposal to
install the new one.

This reverts commit 9711aac.
  • Loading branch information
shlevy committed Dec 7, 2017
1 parent 0235f12 commit bed3695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/tools/package-management/nix/default.nix
Expand Up @@ -160,7 +160,7 @@ in rec {
}) // { perl-bindings = nixStable; };

nixUnstable = (lib.lowPrio (common rec {
name = "nix-unstable-1.12${suffix}";
name = "nix-1.12${suffix}";
suffix = "pre5788_e3013543";
src = fetchFromGitHub {
owner = "NixOS";
Expand Down

11 comments on commit bed3695

@shlevy
Copy link
Member Author

@shlevy shlevy commented on bed3695 Dec 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @orivej

@orivej
Copy link
Contributor

@orivej orivej commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't uninstall the old nix transactionally with the new nix

Do you mean that this did not work, or just that it makes two transactions? The latter is normal because nix-env does not allow installation and uninstallation in one invocation.

nix-env -iA nixUnstable # or -i nix-unstable
nix-env -e nix

Besides, having two versions of Nix installed at the same time is useful (or was until recently when known upgrade blockers were resolved).

This commit effectively makes it impossible to upgrade to nixUnstable with nix-env without mucking about with priorities

Does "this commit" here refer to the commit you have just made, or the reverted commit? The rest of the phrase is about the reverted, but the beginning seems to be about the current.

@shlevy
Copy link
Member Author

@shlevy shlevy commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nix-env -iA nixUnstable # or -i nix-unstable
nix-env -e nix

This gives conflicts if I don't first set priorities.

Does "this commit" here refer to the commit you have just made, or the reverted commit?

The reverted commit.

@orivej
Copy link
Contributor

@orivej orivej commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nixpkgs have default priorities. I did not override them and I can install both versions simultaneously. After reverting this commit locally:

$ nix-env -f . -i -A nixStable -A nixUnstable
installing ‘nix-1.11.15’
installing ‘nix-unstable-1.12pre5788_e3013543’
$ nix-env -q | grep ^nix
nix-1.11.15
nix-unstable-1.12pre5788_e3013543

May you have some custom priorities that cause the conflict?

@shlevy
Copy link
Member Author

@shlevy shlevy commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm.... This is working now, strange. Not sure what was broken before.

I still think the package having a different name is incorrect. It doesn't follow our other conventions, it still requires multiple steps to upgrade, and it's not a new package. But I won't strongly object if you want to revert this revert.

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole -unstable convention has never made sense to me. For example, it breaks upgrading via nix-env -u (it won't upgrade an unstable package to a newer stable one).

@orivej
Copy link
Contributor

@orivej orivej commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow the -unstable convention whenever I can (e.g. an unstable version after a release can be named X.Y.Z.YYYY-MM-DD to be properly comparable), but it is needed for nixUnstable because nix-env -qa (EDIT nix-env -qc) does not recognize priorities and shows the highest version for a name even if it will not be installed by nix-env -u.

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like a minor issue.

@orivej
Copy link
Contributor

@orivej orivej commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but it affects some users, and there are no practical reasons to name the unstable version the same as stable.

BTW, what should one do to let nix-env -u upgrade to Nix 1.12 pre if it is named nix rather than nix-unstable?

@shlevy
Copy link
Member Author

@shlevy shlevy commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orivej There are practical reasons: It breaks nix-env -u, and it violates expectations.

@orivej
Copy link
Contributor

@orivej orivej commented on bed3695 Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should one do to let nix-env -u upgrade to Nix 1.12 pre if it is named nix rather than nix-unstable?

To answer my own question, one should put this into the Nix config:

{
  packageOverrides = pkgs: with pkgs; {
    nixStable = lowPrio nixStable;
  };
}

There are practical reasons: It breaks nix-env -u, and it violates expectations.

I expect that the current users of nixUnstable will not want to switch to Nix 1.13 pre as soon as 1.12 becomes stable. Hence they will have to take some action to switch to stable. nix-env -i nix; nix-env -e nix-unstable is simple and obvious, more so than the snippet above.

Please sign in to comment.