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

Multiple python2Packages fail the evaluation due to dependencies in the environment. #340183

Open
trofi opened this issue Sep 6, 2024 · 4 comments
Labels

Comments

@trofi
Copy link
Contributor

trofi commented Sep 6, 2024

Affected packages are at least:

  • pypy27Packages.incremental
  • pypy2Packages.python-socketio-v4
  • pypy2Packages.python-engineio-v3

Changes like #335112 broke the evaluation for pythonPackages. Example failure:

$ nix-instantiate -A pypy27Packages.incremental
error:
       … while evaluating the attribute 'drvPath'
         at /tmp/z/nixpkgs/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while evaluating the attribute 'drvPath'
         at /tmp/z/nixpkgs/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: cannot coerce a set to a string: { scripts = «thunk»; }

This is a "syntactic" error of a non-catchable exception.

Note that this specific package used to fail with a catchable excaption:

$ nix-instantiate -A pypy27Packages.incremental
error:
       … while evaluating the attribute 'drvPath'
         at /tmp/z/nixpkgs/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while evaluating the attribute 'drvPath'
         at /tmp/z/nixpkgs/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: click-8.1.7 not supported for interpreter pypy

Expected behavior

The exception should be catchable and report unsupported interpreter.

Additional context

My naive attempts to move attrsets out of the environment were rejected in:

And the suggestion was: #338559 (comment)

"""
You can fix buildPythonPackage instead.

You'd have to replicate b9138b7c072f5 in pkgs/development/interpreters/python/python2/mk-python-derivation.nix.
"""

I don't think I can pull it out without investing some time to understand how python wraps and filters attributes just to restore the evaluation of packages.

Notify maintainers

Maybe python team: @mweinelt @natsukium

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.6, NixOS, 24.11 (Vicuna), 24.11.20240906.0e0665d`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.4`
 - channels(root): `""`
 - channels(slyfox): `""`
 - nixpkgs: `/run/current-system/sw/share/nixos-flakes/inputs/nixpkgs`

Add a 👍 reaction to issues you find important.

@trofi trofi added the 0.kind: bug Something is broken label Sep 6, 2024
@mweinelt
Copy link
Member

mweinelt commented Sep 6, 2024

As long as we don't recurse into these package sets we cannot guarantee things won't break all the time. And for that we'd need someone to care about pypy a lot.

@trofi
Copy link
Contributor Author

trofi commented Sep 6, 2024

FWIW I think pythonPackages is in roughly the same boat:

$ NIXPKGS_ALLOW_INSECURE=1 nix-instantiate -A pythonPackages.incremental
error:
       … while evaluating the attribute 'drvPath'
         at /home/slyfox/dev/git/nixpkgs-master/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while evaluating the attribute 'drvPath'
         at /home/slyfox/dev/git/nixpkgs-master/lib/customisation.nix:365:7:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: cannot coerce a set to a string: { scripts = «thunk»; }

@dotlambda

This comment was marked as duplicate.

@dotlambda dotlambda changed the title Multiple pythonPackages fail the evaluation due to dependencies in the environment. Multiple python2Packages fail the evaluation due to dependencies in the environment. Sep 6, 2024
@trofi
Copy link
Contributor Author

trofi commented Oct 3, 2024

A few more fresh eval regressions with the same cause:

  • $ nix-instantiate -A pypy27Packages
  • $ nix-instantiate -A pypy27Packages.pytest_7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants