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

Cannot find bazel_vscode_compdb #19

Open
haidongx opened this issue Sep 14, 2024 · 3 comments
Open

Cannot find bazel_vscode_compdb #19

haidongx opened this issue Sep 14, 2024 · 3 comments

Comments

@haidongx
Copy link

haidongx commented Sep 14, 2024

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
Copy link
Author

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

@wuwenbin
Copy link

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

@faximan
Copy link

faximan commented Nov 15, 2024

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

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

No branches or pull requests

3 participants