-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
python3: Enabling optimisations as documented leads to duplicated packages when pulling in aiohttp or filelock #163639
Comments
The issue is the hooks are not being overridden. This results in them providing the default unoptimised versions. Because the other native build input also propagate these packages, but the correct ones, we get collisions. |
Interpreters have an attribute
and
which picks up the build for host interpreter from the spliced package set. In other words, the only way to override correctly is by using an overlay. Nixpkgs at e1212c4 and file with import ./. {};
let
python = python3.override {
reproducibleBuild = true;
enableOptimizations = false;
rebuildBytecode = false;
enableLTO = false;
self = python;
};
in { inherit python; } [freddy@fr-yoga:~/code/nixpkgs]$ nix-build python.nix -A python
/nix/store/i7sapm6pi7323l730kjf54aap7r3awr0-python3-3.9.12
[freddy@fr-yoga:~/code/nixpkgs]$ nix-build python.nix -A python.pythonForBuild
/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12
[freddy@fr-yoga:~/code/nixpkgs]$ nix-build -A python3
/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12
[freddy@fr-yoga:~/code/nixpkgs]$ nix-build -A python3.pythonForBuild
/nix/store/hym1n0ygqp9wcm7pxn4sfrql3fg7xa09-python3-3.9.12 |
Fix in #169475. |
Overriding the interpreters did not work correctly. When overriding packages would end up twice in the build time closure: one corresponding to the overridden interpreter and one corresponding to the original interpreter. The reason is that the override was not applied to the interpreters in the spliced package sets.
Thanks! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/why-is-the-nix-compiled-python-slower/18717/5 |
Describe the bug
According to the Nix Python docs, it should be possible to enable optimisations using
python3.override
. However, this doesn't actually appear to work if some packages are required, among them aiohttp and filelock.Steps To Reproduce
Try to build the following flake:
Expected behavior
This should build successfully.
Additional context
The
nix-store -q --tree
output is 2245 lines long, but the two different instances of the libraries are clearly visible: filelock-deps.txtNot sure I understand what is going on here, but does this potentially involve some cyclic dependencies between Python packages?
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: