-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Fix infinite recursion for aliases in pkgs/top-level/python-aliases.nix #787
Conversation
One thing I thought of doing instead is just using the normalized nixpkgs attrset as a base, without adding normalization as an overlay. That should get things building again and also allow us to find some unnormalized names in overrides. |
Do you mean using I think that would be a nicer solution as well. But I'm not sure if we can make it work: One thing I'm not sure about is that then any package we include directly from the raw Or can we avoid including any package from |
No, I mean replacing |
@K900 do you mean something like this? |
@adisbladis Can you take a look at this? It'd be swell if we could address the infinite recursion issue with aliased packages. |
@adisbladis Gentle ping |
@adisbladis Ping. This is blocking an upgrade for us. |
@adisbladis Any chance you can take a look at this? Otherwise, I'll try this out on a recent version of |
I'm using this poetry2nix branch and it was working. But if I update warning: Git tree '/home/thiago/Sources/github/invesalius3_nix_develop' is dirty
error: infinite recursion encountered
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:311:7:
310| depsBuildBuild = lib.elemAt (lib.elemAt dependencies 0) 0;
311| nativeBuildInputs = lib.elemAt (lib.elemAt dependencies 0) 1;
| ^
312| depsBuildTarget = lib.elemAt (lib.elemAt dependencies 0) 2;
… while evaluating the attribute 'nativeBuildInputs' of the derivation 'python3.10-python3.10-wheel-0.38.4'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'outPath'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/lib/customisation.nix:214:7:
213| drvPath = assert condition; drv.drvPath;
214| outPath = assert condition; drv.outPath;
| ^
215| };
… while evaluating 'optionalString'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/lib/strings.nix:213:5:
212| # String to return if condition is true
213| string: if cond then string else "";
| ^
214|
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/build-support/trivial-builders.nix:575:12:
574| cp ${script} $out/nix-support/setup-hook
575| '' + lib.optionalString (deps != []) ''
| ^
576| printWords ${toString deps} > $out/nix-support/propagated-build-inputs
… while evaluating the attribute 'buildCommand' of the derivation 'wheel-unpack-hook.sh'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'nativeBuildInputs' of the derivation 'python3.10-parso-0.8.3'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'out.outPath'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/lib/customisation.nix:207:13:
206| drvPath = assert condition; drv.${outputName}.drvPath;
207| outPath = assert condition; drv.${outputName}.outPath;
| ^
208| };
… while evaluating anonymous lambda
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/lib/lists.nix:646:25:
645| */
646| unique = foldl' (acc: e: if elem e acc then acc else acc ++ [ e ]) [];
| ^
647|
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:52:6:
51| modules = lib.filter hasPythonModule drvs;
52| in lib.unique ([python] ++ modules ++ lib.concatLists (lib.catAttrs "requiredPythonModules" modules));
| ^
53|
… while evaluating 'requiredPythonModules'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:50:27:
49| # Get list of required Python modules given a list of derivations.
50| requiredPythonModules = drvs: let
| ^
51| modules = lib.filter hasPythonModule drvs;
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:67:33:
66| pythonPath = [ ]; # Deprecated, for compatibility.
67| requiredPythonModules = requiredPythonModules drv.propagatedBuildInputs;
| ^
68| };
… while evaluating 'requiredPythonModules'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:50:27:
49| # Get list of required Python modules given a list of derivations.
50| requiredPythonModules = drvs: let
| ^
51| modules = lib.filter hasPythonModule drvs;
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:67:33:
66| pythonPath = [ ]; # Deprecated, for compatibility.
67| requiredPythonModules = requiredPythonModules drv.propagatedBuildInputs;
| ^
68| };
… while evaluating 'requiredPythonModules'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:50:27:
49| # Get list of required Python modules given a list of derivations.
50| requiredPythonModules = drvs: let
| ^
51| modules = lib.filter hasPythonModule drvs;
… from call site
at /nix/store/qrfavlffxx8a8d3mkb5zp474z0835ryr-source/default.nix:279:23:
278| */
279| storePackages = requiredPythonModules (builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs));
| ^
280| in
… while evaluating the attribute 'poetryPackages'
at /nix/store/qrfavlffxx8a8d3mkb5zp474z0835ryr-source/default.nix:283:7:
282| python = py;
283| poetryPackages = storePackages
| ^
284| ++ lib.optional hasScripts scriptsPackage
… while evaluating anonymous lambda
at /nix/store/qrfavlffxx8a8d3mkb5zp474z0835ryr-source/default.nix:351:39:
350| in
351| poetryPython.python.withPackages (ps: envPkgs ++ (extraPackages ps));
| ^
352|
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/with-packages.nix:3:19:
2|
3| f: let packages = f pythonPackages; in buildEnv.override { extraLibs = packages; }
| ^
… while evaluating 'requiredPythonModules'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/python-packages-base.nix:50:27:
49| # Get list of required Python modules given a list of derivations.
50| requiredPythonModules = drvs: let
| ^
51| modules = lib.filter hasPythonModule drvs;
… from call site
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/development/interpreters/python/wrapper.nix:20:13:
19| env = let
20| paths = requiredPythonModules (extraLibs ++ [ python ] ) ;
| ^
21| pythonPath = "${placeholder "out"}/${python.sitePackages}";
… while evaluating the attribute 'passAsFile'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/build-support/buildenv/default.nix:77:5:
76| # XXX: The size is somewhat arbitrary
77| passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
| ^
78| }
… while evaluating the attribute 'passAsFile' of the derivation 'python3-3.10.8-env'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
… while evaluating the attribute 'buildInputs' of the derivation 'nix-shell'
at /nix/store/wm2w45lg0dqrcfrn54dijw30ljpx5k8k-source/pkgs/stdenv/generic/make-derivation.nix:270:7:
269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
270| name =
| ^
271| let
|
@tfmoraes Just eyeballing that stack trace it looks to me like a different recursion issue than this one. Could you open a new issue? |
This achieves the same thing I wanted to with normalisation, so I'm happy with this. |
Done @adisbladis! I opened this issue #850 |
This fixes #750.
A better fix for this might be to set e.g.
meta.isAlias = true
in nixpkgs/blob/master/pkgs/top-level/python-aliases.nix. Let me know if that is a better route :).