Closed davidzchen closed 1 month ago
@fmeum - I've actually tracked this down to #280 - I'm not familiar with the process of using modules yet so not sure what the issue here is; can you take a look?
The error goes away with --cxxopt=-std=c++17
, so I suspect that clang is defaulting to C++20 modules rather than Clang modules with C++20 enabled, but Bazel only supports Clang modules. I didn't find a way to force the use of Clang modules even with C++20, but this needs to be fixed in Bazel itself.
So are you saying that we need to have clang module support on if using c++20? Before #280 this wasn't the case and if I back out that commit I can happily compile with c++20 (although layering_check seems broken without this as it fails to find the builtin headers in my project)
Only if you use --features=layering_check
. If I add --features=-layering_check
to the reproducer, it also compiles just fine. Compiling with C++20 looks fine even with #280, it's just layering_check
that is broken.
This can be fixed with --cxxopt=-Xclang --cxxopt=-fno-cxx-modules
. I will send a PR to add this to Bazel's toolchain configuration.
I have a Bazel C++ repository where I am using
toolchains_llvm
. On macOS, it builds just fine, but on Ubuntu on WSL, I am getting the following error:Here is the repository. I created a minimal repro case for this issue: https://github.com/davidzchen/bazel-ycm-test
Is there a misconfiguration on my part, and how do I fix this? Please let me know if there are any additional information I should provide to debug this.