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

python: don't use optimizations on Darwin #90174

Merged
merged 1 commit into from Jun 12, 2020
Merged

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Jun 12, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jun 12, 2020
@FRidh
Copy link
Member Author

FRidh commented Jun 12, 2020

Should fix #89912.

@FRidh FRidh mentioned this pull request Jun 12, 2020
@FRidh FRidh changed the title python3: don't use optimizations on Darwin python: don't use optimizations on Darwin Jun 12, 2020
@FRidh
Copy link
Member Author

FRidh commented Jun 12, 2020

@GrahamcOfBorg build python2 python3 python37

@vcunat
Copy link
Member

vcunat commented Jun 12, 2020

The darwin failure seems unrelated (OOM killer, perhaps). Let me try again:
@GrahamcOfBorg build python3

@vcunat
Copy link
Member

vcunat commented Jun 12, 2020

The borg build failed even on the retry. I don't know how to best verify this.

@FRidh
Copy link
Member Author

FRidh commented Jun 12, 2020

Just asked on nix-darwin if anyone could run

$ nix build -f https://github.com/FRidh/nixpkgs/archive/opt-darwin.tar.gz python python3 

@FRidh
Copy link
Member Author

FRidh commented Jun 12, 2020

@GrahamcOfBorg build python3 python37

Also, don't use autoreconfHook on Darwin with Python 3.
Darwin builds are still impure and fail with

    ld: warning: directory not found for option '-L/nix/store/6yhj9djska835wb6ylg46d2yw9dl0sjb-configd-osx-10.8.5/lib'
    ld: warning: directory not found for option '-L/nix/store/6yhj9djska835wb6ylg46d2yw9dl0sjb-configd-osx-10.8.5/lib'
    ld: warning: object file (/nix/store/0lsij4jl35bnhqhdzla8md6xiswgig5q-Libsystem-osx-10.12.6/lib/crt1.10.6.o) was built for newer OSX version (10.12) than being linked (10.6)
    DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.8.3.drv-0/Python-3.8.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/dsb7d4dwxk6bzlm845z2zx6wp9a8bqc1-bash-4.4-p23/bin/bash: line 5: 72015 Killed: 9               DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-3.8.3.drv-0/Python-3.8.3 ./python.exe -E -S -m sysconfig --generate-posix-vars
    generate-posix-vars failed
    make: *** [Makefile:592: pybuilddir.txt] Error 1
@FRidh
Copy link
Member Author

FRidh commented Jun 12, 2020

Build succeeded according to our remote darwin builders over irc.
https://gist.github.com/cransom/9058b4e1b49ac13e62b223a42f8ab6d2
https://gist.github.com/cransom/b12e88534b5f6060f5292f6f0c4c94e3

@FRidh FRidh merged commit 4087d3f into NixOS:staging-next Jun 12, 2020
@stolyaroleh
Copy link

Maybe a better idea would be to look at stdenv.cc.isClang instead? Otherwise, it will still attempt to build Python with optimizations when building with clang on Linux instead of gcc.

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

Successfully merging this pull request may close these issues.

None yet

3 participants