Cannot find bazel_vscode_compdb
The command
bazel build --override_repository=bazel_vscode_compdb=/Users/hdx/.vscode/extensions/stackbuild.bazel-stack-vscode-cc-1.2.0/compdb/ --aspects=@bazel_vscode_compdb//:aspects.bzl%compilation_database_aspect ......
ERROR: Unable to find package for @@[unknown repo 'bazel_vscode_compdb' requested from @@]//:aspects.bzl: The repository '@@[unknown repo 'bazel_vscode_compdb' requested from @@]' could not be resolved: No repository visible as '@bazel_vscode_compdb' from main repository.
So, it just the the build rule cannot pick up the local bazel_vscode_compdb or the aspect. This command might need to be updated.
A short term solution I used is, modify the --aspects flag:
- Copy the aspects bzl file to my codebase as compdb_aspects.bzl
- Run the generation command with
--aspects=compdb_aspects.bzl%compilation_database_aspect
In my case, the issue was caused by Bazel 7 enabling bzlmod by default, which seemed to be incompatible with this tool. My solution was to disable bzlmod in the .bazelrc file by adding the following line:
build --noenable_bzlmod
--noenable_bzlmod is unfortunately not an option if your project is on bzlmod...
I guess this can be considered as a feature request to support bzlmod.
I also had this problem with my project. I second the request to support bzlmod. Bzlmod will be mandatory in Bazel 9, and some workspace rules are already broken in the current Bazel version, so depending on what your project uses, you are required to migrate to Bzlmod in order to use the latest Bazel version. After Bazel 9, this extension will be broken...
+1 also requesting support for bzlmod, would be lit
Yep, hope this feature can be supported