-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Excessive CPU/Memory utilization evaluating cross-compiled packages causing OOMs during evaluation #338231
Comments
Splicing is the cause, and probably the importing of multiple sets contributes too. |
The cause is the override function introduced in #169475. Bypassing it makes cross evals of python apps much cheaper. diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 56e0be3ea59c..4002c7b619bd 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -132,7 +132,7 @@ let
# When we override the interpreter we also need to override the spliced versions of the interpreter
# bluez is excluded manually to break an infinite recursion.
inputs' = lib.filterAttrs (n: v: n != "bluez" && n != "passthruFun" && ! lib.isDerivation v) inputs;
- override = attr: let python = attr.override (inputs' // { self = python; }); in python;
+ override = attr: attr
in passthruFun rec {
inherit self sourceVersion packageOverrides;
implementation = "cpython"; |
Ah this is the culprit! Applying the patch fixes the unsolved mystery of evaluation failures plaguing my hydra for an entire year and counting. |
@NickCao am I missing something? what patch? edit: I'm not smart, you were likely referring to Martin's comment above. |
But doesn't that break cross? |
If the interpreter is overridden, yes. But normally that's not the case? |
FWIW, Just ran into this issue with Edit: Not sure if this is related (or related to the workaround), but although eval is "fixed", the memory usage blows up completely during the
Edit2: This was actually related to #346715 , it doesn't explode like this with only the workaround on master. |
Describe the bug
Evaluating certain cross-compiled packages uses an order or two of magnitude more resources than their native counterparts. See the discourse post and subsequent
nix
investigation below.Steps To Reproduce
Steps to reproduce the behavior:
nix eval --no-eval-cache .#python
and look at memory usagenix eval --no-eval-cache .#pythonCross
and look at memory usage (if this doesn't OOM)Expected behavior
Both of these should evaluate in reasonable time.
Screenshots
On my machine I have the following results:
Additional context
https://discourse.nixos.org/t/unexpected-massive-memory-usage-when-evaluating-a-derivation-from-a-cross-compiling-nixpkgs/51039/2
NixOS/nix#7698 (comment)
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: