Skip to content
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

python: fix full builds by referring to the correct interpreter (fixes #114475) #114538

Merged
merged 1 commit into from
Feb 27, 2021

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Feb 27, 2021

The package set is an attribute of the interpreter. The function to
build an environment (buildEnv/withPackages) is part of the
interpreter. The interpreter is passed to itself, and needs to be
updated when overridden.

For cross-compilation we splice the package set, and for that the
various build/host interpreters and sets need to be available. We
select these currently through pkgs.${pythonAttr}. The pythonAttr
attribute was not fixed for pythonFull.

NixOS/rfcs#83
#104201

We need a better solution for this because this is very brittle.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -191,6 +191,7 @@ in {
# Minimal versions of Python (built without optional dependencies)
python3Minimal = (python38.override {
self = python3Minimal;
pythonAttr = "python3Minimal";
Copy link
Member Author

Choose a reason for hiding this comment

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

this one is actually unused as its used "only" for bootstrapping

The package set is an attribute of the interpreter. The function to
build an environment (`buildEnv`/`withPackages`) is part of the
interpreter. The interpreter is passed to itself, and needs to be
updated when overridden.

For cross-compilation we splice the package set, and for that the
various `build/host` interpreters and sets need to be available. We
select these currently through `pkgs.${pythonAttr}`. The `pythonAttr`
attribute was not fixed for `pythonFull`.

NixOS/rfcs#83
NixOS#104201

We need a better solution for this because this is very brittle.
@FRidh
Copy link
Member Author

FRidh commented Feb 27, 2021

@GrahamcOfBorg build python3Full.tests

@FRidh FRidh requested a review from jonringer February 27, 2021 08:02
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Feb 27, 2021
@FRidh FRidh merged commit 0dc64d5 into NixOS:master Feb 27, 2021
@FRidh FRidh deleted the pythonfull branch February 27, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant