Skip to content

python3.withPackages: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta) #461884

Closed

Description

@dwt

Edit: Discovering what happens took a few turns, which is why the initial report is about a failing rust build, which is where I discovered the problem.

This regression was likely introduced in #442540 where the python executable in buildEnv changed and no longer gets NIX_PYTHONPREFIX and NIX_PYTHONPATH, more detail at the bottom in #461884 (comment)

original first issue text

Nixpkgs version

  • Unstable (25.11)

Describe the bug

❯ git describe HEAD
25.11-pre-94963-ga40339417f4b
❯ nix-build --attr korrect --eval-system x86_64-linux
trace: evaluation warning: buildRustPackage: `useFetchCargoVendor` is non‐optional and enabled by default as of 25.05, remove it
these 2 derivations will be built:
  /nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv
  /nix/store/jnm94cchf35rxrrpydsmfw437dnzvkdr-korrect-0.3.3.drv
building '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' on 'ssh-ng://rosetta-builder'...
copying 0 paths...
building '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv'...
Traceback (most recent call last):
  File "/nix/store/f2aiivbcplcfk3c30dmjgl0iw96yvwaz-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 16, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
error: build of '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' on 'ssh-ng://rosetta-builder' failed: Cannot build '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/n6gidz7rcxb7drwvhg4k2igfjhwd56d0-korrect-0.3.3-vendor
       Last 4 log lines:
       > Traceback (most recent call last):
       >   File "/nix/store/f2aiivbcplcfk3c30dmjgl0iw96yvwaz-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 16, in <module>
       >     import requests
       > ModuleNotFoundError: No module named 'requests'
       For full logs, run:
         nix log /nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv
error: builder for '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/jnm94cchf35rxrrpydsmfw437dnzvkdr-korrect-0.3.3.drv' failed to build

Steps to reproduce

Either checkout the commit mentioned above, or use nixpkgs-review like this: nix-review pr 460269 --systems x86_64-linux

Expected behaviour

Should work?

Screenshots

No response

Relevant log output

See above

Additional context

No response

System metadata

❯ nix-shell -p nix-info --run "nix-info -m"
fetching path input 'path:/nix/store/ipyw6f3ah05zxy1imaydg5bmr8qmsiyc-source'

  • system: "aarch64-darwin"
  • host os: Darwin 25.1.0, macOS 26.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Lix, like Nix) 2.93.3 System type: aarch64-darwin Additional system types: aarch64-darwin, x86_64-darwin Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /Users/dwt/.config/nix/nix.conf:/Users/dwt/.nix-profile/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/wags9ajivrc1r24z9qx5glny5n8q5i4g-lix-2.93.3/share
  • nixpkgs: /nix/store/ipyw6f3ah05zxy1imaydg5bmr8qmsiyc-source

Notify maintainers

not sure how to find the maintainers, as this is on the rust build toolchain. Other bugs mentioned these people:


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    on Nov 15, 2025
  2. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    Some maybe relevant information: For x86_64-linux builds, I use a vm (I'm on an aarch64 Mac) that I have built via github:cpick/nix-rosetta-builder. That should not be a reason for this issue, but I did have problems with rosetta, especially under linux before, so perhaps this is part of the reason for this problem. It does however look different than the issues I had with rosetta in the past, as those have always been crashes in binary code, or code hangs, never something like an import package missing.

  3. eclairevoyant commented on Nov 15, 2025

    @eclairevoyant
    Contributor

    The PR builds fine on my machine.

  4. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    @eclairevoyant thanks!

    Looking at the source, this looks correct too:

    fetchCargoVendorUtil = writers.writePython3Bin "fetch-cargo-vendor-util" {
    libraries =
    with python3Packages;
    [
    requests
    ]
    ++ requests.optional-dependencies.socks; # to support socks proxy envs like ALL_PROXY in requests
    flakeIgnore = [
    "E501"
    ];
    } (builtins.readFile ./fetch-cargo-vendor-util.py);

    seems to correctly pull in requests.

  5. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    Digging into this, it seems that on my builder-vm, the python interpreter that is used by fetch-cargo-vendor-util is somehow configured wrong. Here are some observations:

    ❯ nix-build -A korrect --eval-system x86_64-linux
    these 2 derivations will be built:
      /nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv
      /nix/store/jnm94cchf35rxrrpydsmfw437dnzvkdr-korrect-0.3.3.drv
    building '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' on 'ssh-ng://rosetta-builder'...
    copying 0 paths...
    building '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv'...
    Traceback (most recent call last):
      File "/nix/store/f2aiivbcplcfk3c30dmjgl0iw96yvwaz-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 16, in <module>
        import requests
    ModuleNotFoundError: No module named 'requests'
    error: build of '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' on 'ssh-ng://rosetta-builder' failed: Cannot build '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv'.
           Reason: builder failed with exit code 1.
           Output paths:
             /nix/store/n6gidz7rcxb7drwvhg4k2igfjhwd56d0-korrect-0.3.3-vendor
           Last 4 log lines:
           > Traceback (most recent call last):
           >   File "/nix/store/f2aiivbcplcfk3c30dmjgl0iw96yvwaz-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util", line 16, in <module>
           >     import requests
           > ModuleNotFoundError: No module named 'requests'
           For full logs, run:
             nix log /nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv
    error: builder for '/nix/store/j4x6ym8xky0ms0vqksk7abch3pl3m5ns-korrect-0.3.3-vendor.drv' failed with exit code 1
    error: 1 dependencies of derivation '/nix/store/jnm94cchf35rxrrpydsmfw437dnzvkdr-korrect-0.3.3.drv' failed to build
    
    # switching to build vm for ease of debugging
    [nix-shell:~]$ head -n1 /nix/store/f2aiivbcplcfk3c30dmjgl0iw96yvwaz-fetch-cargo-vendor-util/bin/fetch-cargo-vendor-util
    #! /nix/store/4pmq43mf40swpvhx7car5854r8plflw6-python3-3.13.9-env/bin/python3.13
    
    [nix-shell:~]$ /nix/store/4pmq43mf40swpvhx7car5854r8plflw6-python3-3.13.9-env/bin/python3.13 -c "import sys; print(sys.path)
    > "
    ['', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python313.zip', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13/lib-dynload', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13/site-packages']
    
    [nix-shell:~]$ ls /nix/store/4pmq43mf40swpvhx7car5854r8plflw6-python3-3.13.9-env/lib/python3.13/site-packages/req*
    /nix/store/4pmq43mf40swpvhx7car5854r8plflw6-python3-3.13.9-env/lib/python3.13/site-packages/requests:
    adapters.py  compat.py      hooks.py            packages.py      structures.py
    api.py       cookies.py     __init__.py         __pycache__      utils.py
    auth.py      exceptions.py  _internal_utils.py  sessions.py      __version__.py
    certs.py     help.py        models.py           status_codes.py
    
    /nix/store/4pmq43mf40swpvhx7car5854r8plflw6-python3-3.13.9-env/lib/python3.13/site-packages/requests-2.32.5.dist-info:
    licenses  METADATA  RECORD  top_level.txt  WHEEL

    This implies that the built python virtual env (on the builder) is missing the correct python path and is not including the site-packages directory of itself that contains the requests package.

    Not quite sure yet what this means, but it starts to look less likely that this is darwin rosetta problem.

  6. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    This is a somewhat minimal reproduction:

    [nix-shell:~/nixpkgs]$ nix-build --eval-system x86_64-linux -E '
      with import ./. {};
      writers.writePython3Bin "py-writer-test" { libraries = [ python3Packages.requests ]; } "
    import requests
    print(\"WRITER OK\", requests.__file__)
    "
    '; result/bin/py-writer-test; head -1 result/bin/py-writer-test | cut -c3- | xargs -I% sh -c " % -c 'import sys; print(sys.path)'"
    /nix/store/gvz74vz5vd1yk3w3hj1a982f7l7vws90-py-writer-test
    Traceback (most recent call last):
      File "/home/builder/nixpkgs/result/bin/py-writer-test", line 3, in <module>
        import requests
    ModuleNotFoundError: No module named 'requests'
    ['', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python313.zip', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13/lib-dynload', '/nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/lib/python3.13/site-packages']
    
    [nix-shell:~/nixpkgs]$ nix-build  -E '
      with import ./. {};
      writers.writePython3Bin "py-writer-test" { libraries = [ python3Packages.requests ]; } "
    import requests
    print(\"WRITER OK\", requests.__file__)
    "
    '; result/bin/py-writer-test; head -1 result/bin/py-writer-test | cut -c3- | xargs -I% sh -c " % -c 'import sys; print(sys.path)'"
    /nix/store/6gg43sh3l5xs1z50m19a5y46ck2vj00v-py-writer-test
    WRITER OK /nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/site-packages/requests/__init__.py
    ['', '/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python313.zip', '/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13', '/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/lib-dynload', '/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/site-packages']

    As far as I can see, with --eval-system x86_64-linux the python environment gets built wrong.

    Now this looks more like a problem with writers.writePython3Bin?

  7. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    Manually adding in the correct environment variables makes it work, so it's probably 'just' a problem with the wrapper generator:

    [nix-shell:~/nixpkgs]$ cat manual-wrapper.nix
    { pkgs ? import ./. { system = "x86_64-linux"; } }:
    
    let
      pyEnv = pkgs.python3.buildEnv.override {
        extraLibs = [ pkgs.python3Packages.requests ];
        ignoreCollisions = true;
      };
      sp = "${pyEnv}/${pkgs.python3.sitePackages}";
    in
    pkgs.writeShellScript "manual-py-env" ''
    
      export NIX_PYTHONPATH="${sp}"
      export NIX_PYTHONPREFIX="${pyEnv}"
    
      ${pkgs.python3.interpreter} "$@"
    ''
    
    [nix-shell:~/nixpkgs]$ nix-build manual-wrapper.nix; ./result -c "import requests; print(requests)"
    /nix/store/nxcxf8y1nk3502zkksyx4widkjd564a9-manual-py-env
    <module 'requests' from '/nix/store/2cdy906ya1hj6p6ywihzxgap94brkwng-python3-3.13.9-env/lib/python3.13/site-packages/requests/__init__.py'>
  8. changed the title [-]fetch-cargo-vendor-util: Build fails on x86_64-linux because requests not available[/-] [+]writers.writePython3Bin: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta)[/+] on Nov 15, 2025
  9. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    Looking at the source in nixpkgs, this line

    if pythonPackages != pkgs.pypy2Packages || pythonPackages != pkgs.pypy3Packages then

    looks suspicious to me. Wouldn't that always be true? To me this reads like if something is not this or not that. Likely not the reason for this bug, but strange none the less.

    Introduced here: f6e0ee5 - sadly the commit comment doesn't make clear to my why this change was done.

  10. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    This fails already in python3.withPackages:

    [nix-shell:~/nixpkgs]$ cat experiment-x86.nix
    with import ./. { };
    
    let
      env = python3.withPackages (ps: [ ps.requests ]);
    in
    # Create a derivation that runs a Python one-liner during build.
    runCommand "py-import-x86" { buildInputs = [ env ]; } ''
      set -e
      echo "Interpreter: ${env}/bin/python3"
      echo "Trying import..."
      if ! ${env}/bin/python3 - <<'EOF' > result.json 2>&1
    import json, sys
    import requests
    json.dump({
      "sys_executable": sys.executable,
      "sys_path": sys.path,
      "requests_file": requests.__file__,
    }, sys.stdout)
    EOF
      then
        echo "FAILED: import requests" >&2
        cat result.json >&2 || true
        exit 1
      fi
      cat result.json
      cp result.json "$out"
    ''
    [nix-shell:~/nixpkgs]$ nix-build experiment-x86.nix
    this derivation will be built:
      /nix/store/7hfp8bwzqj8v4p2qkmbfrddyibb2m706-py-import-x86.drv
    building '/nix/store/7hfp8bwzqj8v4p2qkmbfrddyibb2m706-py-import-x86.drv'...
    Interpreter: /nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/bin/python3
    Trying import...
    {"sys_executable": "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/bin/python3", "sys_path": ["", "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python313.zip", "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13", "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/lib-dynload", "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/site-packages"], "requests_file": "/nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env/lib/python3.13/site-packages/requests/__init__.py"}
    /nix/store/cxbjh3c21bqr387jb22dccg5x0rkfl7y-py-import-x86
    [nix-shell:~/nixpkgs]$ nix-build experiment-x86.nix --eval-system x86_64-linux
    this derivation will be built:
      /nix/store/84hfzlchylybvdfmjahmqkhlrv1p5zwr-py-import-x86.drv
    building '/nix/store/84hfzlchylybvdfmjahmqkhlrv1p5zwr-py-import-x86.drv'...
    Interpreter: /nix/store/lb066idmg8hjkfr3p8klz4aym4vpvsy2-python3-3.13.9-env/bin/python3
    Trying import...
    FAILED: import requests
    Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
    ModuleNotFoundError: No module named 'requests'
    error: Cannot build '/nix/store/84hfzlchylybvdfmjahmqkhlrv1p5zwr-py-import-x86.drv'.
           Reason: builder failed with exit code 1.
           Output paths:
             /nix/store/43z03jjxqh42qhkxpg190bflydjd5p4m-py-import-x86
           Last 6 log lines:
           > Interpreter: /nix/store/lb066idmg8hjkfr3p8klz4aym4vpvsy2-python3-3.13.9-env/bin/python3
           > Trying import...
           > FAILED: import requests
           > Traceback (most recent call last):
           >   File "<stdin>", line 2, in <module>
           > ModuleNotFoundError: No module named 'requests'
           For full logs, run:
             nix log /nix/store/84hfzlchylybvdfmjahmqkhlrv1p5zwr-py-import-x86.drv
    [nix-shell:~/nixpkgs]$ ll /nix/store/lb066idmg8hjkfr3p8klz4aym4vpvsy2-python3-3.13.9-env/lib/python3.13/site-packages/ | grep requests
    lrwxrwxrwx 4 root root 108 Jan  1  1970 requests -> /nix/store/yg71z65c1vi2wj463gapkwd1ckgxh7h3-python3.13-requests-2.32.5/lib/python3.13/site-packages/requests
    lrwxrwxrwx 4 root root 125 Jan  1  1970 requests-2.32.5.dist-info -> /nix/store/yg71z65c1vi2wj463gapkwd1ckgxh7h3-python3.13-requests-2.32.5/lib/python3.13/site-packages/requests-2.32.5.dist-info
  11. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    This commit likely introduced the problem, as it splits how venv creation works, the python executable does not get NIX_PYTHONPREFIX and NIX_PYTHONPATH any more. However the commit message is cryptic, and I cannot find the pull request that discusses this behavior. That commit was rather recent (oktober 3rd 2025) so it is possible I am the first person to find this regression from that change.

    edit: found pull request #442540

  12. changed the title [-]writers.writePython3Bin: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta)[/-] [+]python.buildEnv: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta)[/+] on Nov 15, 2025
  13. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    @qbisi could you please take a look at this? I think I have debugged this down to your change being the likely direct reason for this problem, but am not sure how to proceed from here.

  14. dwt commented on Nov 15, 2025

    @dwt
    ContributorAuthor

    python.withPackages primary interpreter fails to see env site-packages on cross builds after PR #442540 (python: fix venv creation)

    Summary:
    After PR #442540 introduced special-casing of the primary Python wrapper (removing NIX_PYTHONPATH/NIX_PYTHONPREFIX/NIX_PYTHONEXECUTABLE from the main interpreter wrapper), python3.withPackages environments built with --eval-system x86_64-linux (on a different host arch via Rosetta) can no longer import packages added to the environment (e.g. requests). Native builds still work.

    Reproduction:

    1. Native (works):
      $ nix-build -E 'with import ./. {}; python3.withPackages (ps: [ ps.requests ])'
      /nix/store/2idddl847vbppmjazpwgm6xvx5v121k9-python3-3.13.9-env
      $ result/bin/python -c "import sys; print(sys.executable, sys.prefix)"
      /home/builder/nixpkgs/result/bin/python /home/builder/nixpkgs/result
    2. Cross (fails):
      $ nix-build --eval-system x86_64-linux -E 'with import ./. {}; python3.withPackages (ps: [ ps.requests ])'
      /nix/store/lb066idmg8hjkfr3p8klz4aym4vpvsy2-python3-3.13.9-env
      $ result/bin/python -c "import sys; print(sys.executable, sys.prefix); import requests"
      /nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/bin/python3.13 /nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
          import sys; print(sys.executable, sys.prefix); import requests
                                                         ^^^^^^^^^^^^^^^
      ModuleNotFoundError: No module named 'requests'

    Runtime differences (cross vs native):

    • Native: sys.executable and sys.prefix point to the env store path; env site-packages appears on sys.path.
    • Cross: sys.executable and sys.prefix point to base interpreter store path; env site-packages absent.
    • Injecting NIX_PYTHONPATH manually: env NIX_PYTHONPATH=/nix/store//lib/python3.13/site-packages fixes imports (requests loads), confirming sitecustomize relies on these vars.

    Cause:
    Primary interpreter wrapper now omits NIX_PYTHONPATH (and related vars) relying solely on CPython prefix inference. Under cross builds that inference chooses the base interpreter prefix, not the env root, so env site-packages symlinks are never added to sys.path.

    Historical behavior:
    Before PR #442540 all executables (including python itself) exported NIX_PYTHONPATH/NIX_PYTHONPREFIX/NIX_PYTHONEXECUTABLE, making path augmentation independent of prefix inference.

    Impact:
    Breaks python.withPackages usage for cross (eval-system) builds; environment no longer usable for imports unless secondary wrappers are used or NIX_PYTHONPATH is set manually.

  15. changed the title [-]python.buildEnv: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta)[/-] [+]python3.withPackages: python wrapper doesn't load generated env on x86_64-linux (emulated on darwin with rosetta)[/+] on Nov 15, 2025
  16. 20 remaining items

  17. dwt commented on Nov 18, 2025

    @dwt
    ContributorAuthor

    @spinda Indeed, setting this rosetta setting fixes the problem for me

    That is I set this for my linux vm:

    boot.binfmt.registrations.rosetta.preserveArgvZero = lib.mkForce true;

    After applying this, I can no longer reproduce

    # on vm with rosetta support and 
    $ nix-build -E 'with import ./. {}; python3.withPackages (ps: [ ps.requests ])' --eval-system x86_64-linux
    $ result/bin/python -c "import requests

    Interesting enough, this is without the patch from @qbisi (at least the way it is merged, it should not be part of unstable yet, which m linux vm is based on)

    @spinda Now how do we get this fix into nixpkgs? I have not delved into these kinds of settings before. Especially I am not sure about the support policy for nixpkgs on darwin, do we actually still support older versions than MacOS 14?

  18. pyrox0 commented on Nov 18, 2025

    @pyrox0
    Member

    As of 25.11, the minimum supported MacOS version is 14.0(ref:

    - **This release of Nixpkgs requires macOS Sonoma 14.0 or newer, as announced in the 25.05 release notes.**
    The default SDK is now 14.4, but the minimum version is 14.0.
    cc-wrapper will enforce that availability annotations are used or an appropriate deployment target is set.
    See the Darwin platform notes for details.
    )

  19. dwt commented on Nov 18, 2025

    @dwt
    ContributorAuthor

    Thanks @pyrox0 that significantly simplifies things.

    I have a pull request that just changes that setting. Since GitHub (git ops) is currently down, I cannot push my pull request right now, so that will have to wait till tomorrow.

  20. bengsparks commented on Nov 18, 2025

    @bengsparks
    Contributor

    Tacking on to this for an easy reproduce package / posterity: https://hydra.nixos.org/build/313316407
    I can observe an import failure when running on darwin systems, but on aarch64-linux the derivation continues to build.
    See #463023

  21. dwt commented on Nov 19, 2025

    @dwt
    ContributorAuthor

    @bengsparks That sounds very similar to #461406 - there the problem was that the generated wrapper also discarded argv 0, which bombed when the executable wasn't called with the full or relative path.

  22. pinned this issue on Nov 23, 2025
  23. Necoro commented on Nov 25, 2025

    @Necoro
    Member

    Looking at the source in nixpkgs, this line

    nixpkgs/pkgs/build-support/writers/scripts.nix

    Line 1202 in dc55488
    if pythonPackages != pkgs.pypy2Packages || pythonPackages != pkgs.pypy3Packages then

    looks suspicious to me. Wouldn't that always be true? To me this reads like if something is not this or not that. Likely not the reason for this bug, but strange none the less.

    Introduced here: f6e0ee5 - sadly the commit comment doesn't make clear to my why this change was done.

    As a passer-by, just the short info that this line is indeed correct: It excludes PyPy thus executing the code only for CPython. Probably because PyPy is broken as mentioned in a referenced issue further down. This commit also removes all the PyPy-based tests.

  24. eclairevoyant commented on Nov 25, 2025

    @eclairevoyant
    Contributor

    @Necoro you misunderstood. If a != b, then x != a || x != b is always trivially true. That || should be a && most likely.

    Though that's an unrelated bug since we're not using pypy here.

  25. nixos-discourse commented on Nov 28, 2025

    @nixos-discourse
  26. dwt commented on Nov 29, 2025

    @dwt
    ContributorAuthor

    Now that these pull requests have been merged:

    At what point should we close this issue? I can no longer reproduce with these fixes applied, though part of the fix is not in master yet..

  27. linked a pull request that will close this issuestaging-next 2025-12-17 #471587on Dec 21, 2025
  28. unpinned this issue on Dec 31, 2025
  29. added a commit that references this issue on Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: python

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions