-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
building python3Packages.protobuf3_2 on OS X fails due to string include #26531
Comments
#16450 seems related. |
Fixes NixOS#26531 (or works around the issue), which is that python's build_ext target builds the C++ sources using $CC, which doesn't provide the C++ system headers with nix.
@knedlsepp uses Python on Darwin and might help here. |
I've had a look at the python setup tools: The relevant line is (rather: appears to be, I haven't tested this) https://github.com/python/cpython/blob/master/Lib/distutils/unixccompiler.py#L58:
which causes C++ source files to be compile with I see two reasonable ways to fix this bug, in a more principled way than #26606:
If 1. is the right thing to do, it might still be nice to work around the bug in another way for now. |
I've also been bitten by this problem once:
|
@LnL7 @copumpkin any clue how to solve this issue? |
The problem does not seem all-too widespread, but there are a few instances: Search results for: pythonhaskellRother |
…licitly Fixes NixOS#26531. Copies the matplotlib solution, as mentioned by @knedlsepp.
Any reason we can't just change https://github.com/python/cpython/blob/master/Lib/distutils/unixccompiler.py#L58 to use |
I knew this was an issue in general (#18729), but assumed the problem was something more complicated. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tensorflow-on-20-09-mac/11931/5 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-shells-and-python-packages-with-c-extensions/26326/1 |
Issue description
Building the python 3 protobuf package fails for me on macOS.
Digging in (by launching
nix-shell -A python3Packages.protobuf3_2
), the cause seems to be thatpython setup.py build_ext --cpp_implementation
callsCC=clang
instead ofCXX=clang++
. Theclang
call above fails, but the same call works after replacingclang
byclang++
. Similarly,CC=$CXX python setup.py build_ext --cpp_implementation
works fine.That in turn matters because of
in the
clang
/clang++
wrappers, because the system include pathNIX_CXXSTDLIB_COMPILE
is missing in theclang
case.Technical details
When digging in, I used a checkout of nixpkgs with hash 63e9d1c, but it seems to make no difference.
The text was updated successfully, but these errors were encountered: