python-modules/protobuf: fix darwin build by passing C++ includes exp…#26709
python-modules/protobuf: fix darwin build by passing C++ includes exp…#26709LnL7 merged 1 commit intoNixOS:masterfrom
Conversation
…licitly Fixes NixOS#26531. Copies the matplotlib solution, as mentioned by @knedlsepp.
| inherit disabled doCheck; | ||
|
|
||
| # work around python distutils compiling C++ with $CC | ||
| NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; |
There was a problem hiding this comment.
I have hit this in a few places now (and this does indeed fix it). But, this is so weird that it only happens on Darwin. Could it be an LLVM thing? Maybe we could do this globally in LLVM's flags so that we don't have to hack around it so much.
/cc @LnL7 @Ericson2314
There was a problem hiding this comment.
This only works because stdc++ and gcc are in the same package, so it knows where to look as a fallback if the stdenv doesn't add it explicitly because $CC is used. On darwin (and any other clangStdenv) libcxx and clang are separate packages, so even if clang has the same fallback it won't find anything on it's own.
But I'm not sure how this relates to #19585, I'd expect that one would be enough. (#42074 (comment))
…licitly
Fixes #26531.
Copies the matplotlib solution, as mentioned by @knedlsepp.
Motivation for this change
To fix the python-protobuf build on darwin. Obsoletes #26606.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)