Open
Description
I am new to Bazel but need to use it in a project. The project runs in docker container built from an image based on gcr.io/bazel-public/bazel:8.0.0. Since I encountered the No source files found in compile args" error, I have been trying out this patch: #199 (comment).
What I did was cloning bazel-compile-commands-extractor into the workspace as a top-level directory, doing the patch, adding the following scripts to my top-level BUILD.bazel file, and bazel run @hedron_compile_commands//:refresh_all
from the workspace directory.
local_path_override(
module_name = "hedron_compile_commands",
path = "./bazel-compile-commands-extractor",
)
Then compile_commands.json was generated, but there were errors that seem to be package name not recognized. Could anyone help with that please?
(14:09:49) INFO: Found 1 target...
Target @@hedron_compile_commands+//:refresh_all up-to-date:
bazel-bin/external/hedron_compile_commands+/refresh_all
bazel-bin/external/hedron_compile_commands+/refresh_all.check_python_version.py
bazel-bin/external/hedron_compile_commands+/refresh_all.py
(14:09:49) INFO: Elapsed time: 0.678s, Critical Path: 0.01s
(14:09:49) INFO: 1 process: 9 action cache hit, 1 internal.
(14:09:49) INFO: Build completed successfully, 1 total action
(14:09:49) INFO: Running command line: bazel-bin/external/hedron_compile_commands+/refresh_all
>>> Analyzing commands used in @//...
(14:09:50) WARNING: Option 'java_toolchain' is deprecated
(14:09:50) WARNING: Option 'host_java_toolchain' is deprecated
(14:09:50) WARNING: Option 'java_toolchain' is deprecated
(14:09:50) WARNING: Option 'host_java_toolchain' is deprecated
(14:09:50) WARNING: Build options --features and --host_features have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
(14:09:50) ERROR: /workspace/BUILD.bazel: no such target '//:print_args': target 'print_args' not declared in package '' defined by /workspace/BUILD.bazel
(14:09:50) ERROR: /workspace/bazel-compile-commands-extractor/BUILD.bazel:7:25: every rule of type _expand_template implicitly depends upon the target '//:print_args', but this target could not be found because of: no such target '//:print_args': target 'print_args' not declared in package '' defined by /workspace/BUILD.bazel
(14:09:50) WARNING: errors encountered while analyzing target '//bazel-compile-commands-extractor:refresh_all', it will not be built.
Analysis failed
(14:09:50) WARNING: errors encountered while analyzing target '//bazel-compile-commands-extractor:refresh_all.py', it will not be built.
Analysis failed
(14:09:51) ERROR: command succeeded, but there were loading phase errors
(14:09:51) ERROR: Build did NOT complete successfully
>>> Finished extracting commands for @//...
Metadata
Metadata
Assignees
Labels
No labels