3
0
Fork 0
forked from mirrors/nixpkgs

python: don't use optimizations on Darwin

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
This commit is contained in:
Frederik Rietdijk 2020-06-12 08:55:57 +02:00 committed by Frederik Rietdijk
parent febc27b59a
commit 4087d3fe41
2 changed files with 8 additions and 3 deletions

View file

@ -23,6 +23,7 @@
, sha256 , sha256
, passthruFun , passthruFun
, static ? false , static ? false
, enableOptimizations ? (!stdenv.isDarwin)
}: }:
assert x11Support -> tcl != null assert x11Support -> tcl != null
@ -138,8 +139,9 @@ let
--replace 'os.popen(comm)' 'os.popen("${coreutils}/bin/nproc")' --replace 'os.popen(comm)' 'os.popen("${coreutils}/bin/nproc")'
''; '';
configureFlags = [ configureFlags = optionals enableOptimizations [
"--enable-optimizations" "--enable-optimizations"
] ++ [
"--enable-shared" "--enable-shared"
"--with-threads" "--with-threads"
"--enable-unicode=ucs${toString ucsEncoding}" "--enable-unicode=ucs${toString ucsEncoding}"

View file

@ -31,7 +31,9 @@
, stripBytecode ? false , stripBytecode ? false
, includeSiteCustomize ? true , includeSiteCustomize ? true
, static ? false , static ? false
, enableOptimizations ? true # Not using optimizations on Darwin
# configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found.
, enableOptimizations ? (!stdenv.isDarwin)
}: }:
assert x11Support -> tcl != null assert x11Support -> tcl != null
@ -54,8 +56,9 @@ let
version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; version = with sourceVersion; "${major}.${minor}.${patch}${suffix}";
nativeBuildInputs = [ nativeBuildInputs = optionals (!stdenv.isDarwin) [
autoreconfHook autoreconfHook
] ++ [
nukeReferences nukeReferences
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
buildPackages.stdenv.cc buildPackages.stdenv.cc