Skip to content

python3: set an explicit high priority#126038

Closed
ianthehenry wants to merge 1 commit intoNixOS:masterfrom
ianthehenry:python3-priority
Closed

python3: set an explicit high priority#126038
ianthehenry wants to merge 1 commit intoNixOS:masterfrom
ianthehenry:python3-priority

Conversation

@ianthehenry
Copy link
Copy Markdown

@ianthehenry ianthehenry commented Jun 7, 2021

Currently there are multiple derivations named python3, none of which have an explicit meta.priority. This means that nix-env -i python3 will give a different result than nix-env -iA nixpkgs.python3, and nix-env -u is not useful when you have nixpkgs.python3 installed.

So we explicitly raise the priority of nixpkgs.python3, so that nix-env -i python3 will no longer try to install an alpha version of python3 just because it has a higher version number.

Motivation for this change

Fixes #126036

Things done

I verified this change by using nix-env -qa:

$ nix-env -qa python3 --json -f . | jq '.[] |= .meta.priority'   {
  "python310": null,
  "python36": null,
  "python36Full": null,
  "python37Full": null,
  "python37": null,
  "gnuradio3_8Packages.python": -10,
  "python38": null,
  "python38Full": null,
  "python3Full": -10,
  "sourcehut.python": -10,
  "python39": null,
  "python39Full": null
}

Which does not include python3 because it's identical to sourcehut.python3, but can be confirmed separately:

$ nix-env -qaA python3 --json -f . | jq '.[] |= .meta.priority'
{
  "python3": -10
}

Currently there are multiple derivations named python3, none of which have an
explicit meta.priority. This means that nix-env -i python3 will give a
different result than nix-env -iA nixpkgs.python3, and nix-env -u is not useful
when you have nixpkgs.python3 installed.

So we explicitly raise the priority of nixpkgs.python3, so that nix-env -i
python3 will no longer try to install an alpha version of python3 just because
it has a higher version number.
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jun 7, 2021
@r-rmcgibbo
Copy link
Copy Markdown

r-rmcgibbo commented Jun 7, 2021

Result of nixpkgs-review pr 126038 at 259b3b5 run on x86_64-linux 1

14 packages built successfully:
  • bottles
  • esphome
  • kodiPackages.steam-launcher
  • lutris
  • nixopsUnstable
  • octavePackages.symbolic
  • platformio
  • playonlinux
  • protontricks
  • steam
  • steam-run
  • steam-run-native
  • steam-tui
  • steamcmd

Result of nixpkgs-review pr 126038 at 259b3b5 run on aarch64-linux 1

1 package built successfully:
  • nixopsUnstable

@FRidh
Copy link
Copy Markdown
Member

FRidh commented Jun 8, 2021

I don't think we should be doing this. Yes, it resolves the issue for python3, but there are others out there as well. "It is known" that nix-env -i should not be used.

@ianthehenry
Copy link
Copy Markdown
Author

ianthehenry commented Jun 13, 2021

After looking through other derivations with the same problem, I have to agree. I happened to run into the issue with python3, but this same problem affects bash, ruby, sqlite, and over a hundred other top-level packages. I don't think python3 is any more likely to be installed by a new user than one of those, and I certainly don't want to change all of them...

@Janik-Haag Janik-Haag added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nix-env -i python3 is different than nix-env -iA nixpkgs.python3

4 participants