cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
513 stars 79 forks source link

Python 3.10 compilation fails on macOS #135

Closed akaihola closed 1 year ago

akaihola commented 2 years ago

Darker test suite runs on NixOS, on both Linux and macOS. The default.nix file looks like:

with import <nixpkgs> {};
stdenv.mkDerivation {
    name = "darker-test";
    buildInputs = [ python310 git ];
}

In the workflow Nix is installed on both an ubuntu-latest and a macos-latest system (v17 in the cachix-nixos-v17 branch, akaihola/darker#357), and tests are run in a nix-shell:

      - uses: cachix/install-nix-action@v17
        with:
          nix_path: nixpkgs=channel:nixos-21.11
      - name: Run tests in nix-shell
        run: |
          nix-shell --pure --run '
            python -m venv venv
            source venv/bin/activate
            pip install -e '.[isort,test]'
            pytest
          ' ./default.nix

In build #1249, ubuntu-latest succeeds but macos-latest fails when compiling Python 3.10.3:

DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.10.3.drv-0/Python-3.10.3 ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
fi
/nix/store/f5mfx7lc5iad12bp7g9hnxp3aj3f57i9-bash-5.1-p8/bin/bash: line 6: 25876 Killed: 9               DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.10.3.drv-0/Python-3.10.3 ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [Makefile:615: pybuilddir.txt] Error 1
error: builder for '/nix/store/4x7kr702njqcqnddnbb0wyblwmzj6kvl-python3-3.10.3.drv' failed with exit code 2;
       last 10 log lines:
       > ld: warning: directory not found for option '-L/nix/store/51kww2slyma59fzi77lgalzsqx0b8n7r-tzdata-2022a/lib'
       > DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.10.3.drv-0/Python-3.10.3 ./python.exe -E -S -m sysconfig --generate-posix-vars ;\
       > if test $? -ne 0 ; then \
       >  echo "generate-posix-vars failed" ; \
       >  rm -f ./pybuilddir.txt ; \
       >     exit 1 ; \
       > fi
       > /nix/store/f5mfx7lc5iad12bp7g9hnxp3aj3f57i9-bash-5.1-p8/bin/bash: line 6: 25876 Killed: 9               DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.10.3.drv-0/Python-3.10.3 ./python.exe -E -S -m sysconfig --generate-posix-vars
       > generate-posix-vars failed
       > make: *** [Makefile:615: pybuilddir.txt] Error 1
       For full logs, run 'nix log /nix/store/4x7kr702njqcqnddnbb0wyblwmzj6kvl-python3-3.10.3.drv'.
Error: Process completed with exit code 1.

This used to work until mid-April 2022. It crashes with this error both with v16 and after upgrading to v17.

yihuang commented 2 years ago

I have the same issue on my mac when trying to use python310 with nixpkgs-release-21.11. is this issue opened on nixpkgs?

EDIT: switch to nixpkgs master works.

akaihola commented 2 years ago

Hi @yihuang, I haven't opened an issue about this on nixpkgs. I don't have any mac computers, so I couldn't verify whether this is an issue in nixpkgs or only in install-nix-action.

yihuang commented 2 years ago

https://github.com/NixOS/nixpkgs/pull/157775 I guess this fix should be backport to 21.11.