Closed
Description
Steps to reproduce:
- clone https://github.com/bazelbuild/examples/tree/main/cpp-tutorial/stage3
- add the grailbio LLVM toolchain as per their quickstart (don't forget the line in
.bazelrc
) - add the snippet to include the
compile-commands-extractor
- run
bazelisk run @hedron_compile_commands//:refresh_all
Output:
File "$HOME/.cache/bazel/_bazel/008ff1d9dbee3b1e6642ec19c761ba55/execroot/__main__/bazel-out/k8-fastbuild/bin/external/hedron_compile_commands/extract.runfiles/hedron_compile_commands/extract.py", line 128, in _check_in_clang_args_format
assert re.search(r'(?:clang|clang\+\+|gcc|g\+\+)(?:-[0-9\.]+)?$', compile_args[0]), f"Compiler doesn't look like normal clang/gcc. Time to add windows support? CMD: {compile_args}"
AssertionError: Compiler doesn't look like normal clang/gcc. Time to add windows support? CMD: ['external/llvm_toolchain/bin/cc_wrapper.sh', '--target=x86_64-unknown-linux-gnu', '-U_FORTIFY_SOURCE', '-fstack-protector', '-fno-omit-frame-pointer', '-fcolor-diagnostics', '-Wall', '-Wthread-safety', '-Wself-assign', '-std=c++17', '-stdlib=libc++', '-MD', '-MF', 'bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.d', '-frandom-seed=bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.o', '-fPIC', '-iquote', '.', '-iquote', 'bazel-out/k8-fastbuild/bin', '-no-canonical-prefixes', '-Wno-builtin-macro-redefined', '-D__DATE__="redacted"', '-D__TIMESTAMP__="redacted"', '-D__TIME__="redacted"', '-fdebug-prefix-map=external/llvm_toolchain_llvm/=__bazel_toolchain_llvm_repo__/', '-c', 'lib/hello-time.cc', '-o', 'bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.o']
extract.py
does not like the external/llvm_toolchain/bin/cc_wrapper.sh
script. If we fix that regex to also accept the wrapper script, we get: FileNotFoundError: [Errno 2] No such file or directory: 'external/llvm_toolchain/bin/cc_wrapper.sh': 'external/llvm_toolchain/bin/cc_wrapper.sh'
. If that file happens to be vendored in the workspace and just call to a binary from an external repository, the call inside the wrapper script fails.
Not sure what a good way to solve this would be.
Metadata
Metadata
Assignees
Labels
No labels