Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkgs/development/python-modules/protobuf.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, python, buildPythonPackage
, protobuf, google_apputils, pyext
, protobuf, google_apputils, pyext, libcxx
, disabled, doCheck ? true }:

with stdenv.lib;
Expand All @@ -8,6 +8,9 @@ buildPythonPackage rec {
inherit (protobuf) name src;
inherit disabled doCheck;

# work around python distutils compiling C++ with $CC
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))


propagatedBuildInputs = [ protobuf google_apputils ];
buildInputs = [ google_apputils pyext ];

Expand Down