-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
cpython: disable no-semantic-interposition on darwin #129669
cpython: disable no-semantic-interposition on darwin #129669
Conversation
@ofborg build python3 |
|
a430001
to
4372600
Compare
Indeed, that condition is now closer to the root cause for the decision. |
@@ -40,7 +40,7 @@ | |||
, static ? stdenv.hostPlatform.isStatic | |||
, enableOptimizations ? false | |||
# enableNoSemanticInterposition is a subset of the enableOptimizations flag that doesn't harm reproducibility. | |||
, enableNoSemanticInterposition ? true | |||
, enableNoSemanticInterposition ? !stdenv.cc.isClang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case we should leave a comment why it doesn't work on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What it says right now is: not on clang.
I left more details on the commit message, isn't that sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit messages aren't as discoverable when looking at the expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
OfBorg says that the first python3-minimal step still doesn't build:
|
|
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 997cb1c28ff..757aa2925e5 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -40,7 +40,7 @@
, static ? stdenv.hostPlatform.isStatic
, enableOptimizations ? false
# enableNoSemanticInterposition is a subset of the enableOptimizations flag that doesn't harm reproducibility.
-, enableNoSemanticInterposition ? !stdenv.cc.isClang
+, enableNoSemanticInterposition ? (!stdenv.cc.isClang || (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "10"))
# enableLTO is a subset of the enableOptimizations flag that doesn't harm reproducibility.
# enabling LTO on 32bit arch causes downstream packages to fail when linking
, enableLTO ? stdenv.is64bit Like this? |
Yeah, that's what I had in mind. |
4372600
to
4e4c1d0
Compare
@GrahamcOfBorg build python3 |
@GrahamcOfBorg build python38 |
The breakage also affects python 3.8. It's not LTO, I tried disabling it and it failed the same. |
022b9ad
to
66cd2bd
Compare
66cd2bd
to
53a356c
Compare
Quoting #macos:nixos.org:
Can someone familiar with the bootstrap tarballs give that a try? |
Or perhaps use some less problematic python version in the bootstrapping phase? EDIT: I mean, it seems to have worked fine until the last version bump. As a bonus I suspect we wouldn't rebuild all stdenvs every time the default python needs a patch (though a big rebuild is still unavoidable). |
A little bit more context: I think the bootstrap tools job unintentionally dropped libclang_rt / compiler-rt as part of a clang refactor. There was an earlier PR to include compiler-rt in the bootstrap tools (#94426) which has some discussion. This was then subsumed by the changes for Apple Silicon support (#105026). The current set of bootstrap tools were generated in the period in nixpkgs where compiler-rt was not present. Earlier tools included it, and tools built from master also now include it. To fix the current python issue, it’s probably enough to update the bootstrap tools. (Though looking again, the current bootstrap build might include a few too many files with libclang*.a files.) |
It will be best if someone with access to a darwin builder could look into this stdenv blocker. (not me, for example) Ideally they'd also have some knowledge about the darwin stdenv bootstrapping. |
BTW, I see that python 3.9.6 is out. Perhaps one of the fixes might be related to the |
@GrahamcOfBorg build python39.tests |
@ofborg build python39 |
No, that error looks the same 😞 dyld: lazy symbol binding failed: Symbol not found: ___isOSVersionAtLeast Referenced from: /private/tmp/nix-build-python3-minimal-3.9.6.drv-0/Python-3.9.6/libpython3.9.dylib Expected in: flat namespace dyld: Symbol not found: ___isOSVersionAtLeast Referenced from: /private/tmp/nix-build-python3-minimal-3.9.6.drv-0/Python-3.9.6/libpython3.9.dylib Expected in: flat namespace /nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/bin/bash: line 5: 42728 Abort trap: 6 DYLD_LIBRARY_PATH=/private/tmp/nix-build-python3-minimal-3.9.6.drv-0/Python-3.9.6 ./python.exe -E -S -m sysconfig --generate-posix-vars generate-posix-vars failed make: *** [Makefile:619: pybuilddir.txt] Error 1 builder for '/nix/store/znpdfwql7wqwbh6qv3rgman9aqkksfid-python3-minimal-3.9.6.drv' failed with exit code 2 |
> clang-7: error: unknown argument: '-fno-semantic-interposition' This primarily affects current darwin builds, but as soon as they migrate to a newer clang version they will immediately start benefitting from this change.
4b39237
to
fac5757
Compare
I can confirm that updating bootstrap tools is sufficient to build |
@GrahamcOfBorg build python37.tests python38.tests python39.tests |
... to fix the build (merging into staging-next)
Motivation for this change
Not supported on clang, so let's disable it on darwin.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)