bazel-stack-vscode-cc icon indicating copy to clipboard operation
bazel-stack-vscode-cc copied to clipboard

Cannot find bazel_vscode_compdb

Open haidongx opened this issue 1 year ago • 6 comments

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.

haidongx avatar Sep 14 '24 03:09 haidongx

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

haidongx avatar Sep 14 '24 21:09 haidongx

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

wuwenbin avatar Oct 21 '24 12:10 wuwenbin

--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.

faximan avatar Nov 15 '24 14:11 faximan

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...

FelipeLopes avatar Jul 12 '25 14:07 FelipeLopes

+1 also requesting support for bzlmod, would be lit

seanngpack avatar Jul 28 '25 02:07 seanngpack

Yep, hope this feature can be supported

AAArthurLiu avatar Sep 17 '25 01:09 AAArthurLiu