Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cxx_extractor): better error when opening KzipWriter #6117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivucica
Copy link
Contributor

@ivucica ivucica commented May 16, 2024

Add the path to the kzip file to the error message when it fails to open.

When using runextractor compdb from compile_commands.json generated with refresh_compile_commands under Bazel 6.5.x with default system GCC-based toolchain, extractions seem to be reporting en-masse that ALREADY_EXISTS: File already exists, but it is difficult to know what file is being written to.

This makes it easier to triage why this is happening.

@ivucica
Copy link
Contributor Author

ivucica commented May 16, 2024

Does not seem to build for unrelated reasons: https://app.buildbuddy.io/invocation/3870d3f7-df29-4fa6-9c42-6ba10f2a0948#log

With -k flag: https://app.buildbuddy.io/invocation/bac95580-79cc-40f0-8c13-621d0bbd165b

In short, it looks like external workspaces for LLVM and protobuf are failing to build badly.

Add the path to the kzip file to the error message when it fails to
open.

When using `runextractor compdb` from `compile_commands.json`
generated with `refresh_compile_commands` under Bazel 6.5.x with
default system GCC-based toolchain, extractions seem to be reporting
en-masse that `ALREADY_EXISTS: File already exists`, but it is
difficult to know what file is being written to.

This makes it easier to triage why this is happening.
@ivucica
Copy link
Contributor Author

ivucica commented May 16, 2024

(Locally I have Clang+LLVM 16 installed, and not from source code. I've run the build with Bazelisk, which pulled in Bazel 7.1.0. Beyond that, I don't know why the external repos would not be fetched correctly.)

@ivucica ivucica changed the title feat(cxx_indexer): better error when opening KzipWriter feat(cxx_extractor): better error when opening KzipWriter May 16, 2024
@ivucica
Copy link
Contributor Author

ivucica commented May 16, 2024

Really strange:

$ bazel build @@llvm-project//llvm:Demangle
INFO: Analyzed target @@llvm-project//llvm:Demangle (0 packages loaded, 0 targets configured).
ERROR: /tmp/bazel/_bazel_ivucica/be7e2977d85a195914402eddda107797/external/llvm-project/llvm/BUILD.bazel:188:11: Compiling llvm/lib/Demangle/MicrosoftDemangle.cpp failed: (Exit 1): clang failed: error executing CppCompile command (from target @@llvm-project//llvm:Demangle) /usr/lib/llvm-16/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 71 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang: error: no such file or directory: 'external/llvm-project/llvm/lib/Demangle/MicrosoftDemangle.cpp'
clang: error: no input files
Target @@llvm-project//llvm:Demangle failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.138s, Critical Path: 0.03s
INFO: 9 processes: 9 internal.
ERROR: Build did NOT complete successfully
$ sha256sum bazel-kythe/external/llvm-project/llvm/lib/Demangle/MicrosoftDemangle.cpp 
9270a17386ea0c069d54628d0fabbc0681837d2e0860bf66dedb9f40b3da4ef5  bazel-kythe/external/llvm-project/llvm/lib/Demangle/MicrosoftDemangle.cpp

It could be something I haven't yet tried to learn about Bazel modules -- because the repo seems to have been fetched in full.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant