I'm trying to convince Bazel to let me use libc++ on Debian, and the system path autodetection is missing one of the directories for the include files:
If I setup my build with:
export CC=/usr/lib/llvm-8/bin/clang
export CXX=/usr/lib/llvm-8/bin/clang++
.bazelrc:
build:libc++ --action_env=CC
build:libc++ --action_env=CXX
build:libc++ --action_env=CXXFLAGS=--stdlib=libc++
build:libc++ --action_env=PATH
I get the following error:
ERROR: /home/jeffbailey/Programming/gittree/galactic-bloodshed/gb/BUILD:147:1: undeclared inclusion(s) in rule '//gb:gblib':
this rule is missing dependency declarations for the following files included by 'gb/survey.cc':
'/usr/lib/llvm-8/include/c++/v1/stddef.h'
'/usr/lib/llvm-8/include/c++/v1/cstdint'
Looking at external/local_config_cc/BUILD, I see:
cxx_builtin_include_directories = ["/usr/local/include",
"/usr/lib/llvm-8/lib/clang/8.0.0/include",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/include/c++/8",
"/usr/include/x86_64-linux-gnu/c++/8",
"/usr/include/c++/8/backward",
"/usr/include/clang/8.0.0/include"],
If I add:
"/usr/lib/llvm-8/include/c++/v1",
To that list it works fine.
Reading src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcModuleApi.java and the documentation for cxx_builtin_include_directories, it suggests that the paths are determined by gcc -E -xc++ - -v, so I checked on the paths from the compiler by doing:
$CC -stdlib=libc++ -E -xc++ - -v
Which gives:
/usr/lib/llvm-8/bin/../include/c++/v1
/usr/include/clang/8.0.1/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
Is that command actually used to do the detection? Is there another way that I should be showing Bazel what the system include paths are? Or have I tripped across a bug?
Thanks!
Tks,
Jeff Bailey
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/c8d50d3b-4b1b-44ce-a974-d0d7fa560449%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| |||||||