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

error loading package '@build_stack_rules_proto//': cannot load '//rules:proto_gazelle.bzl' #369

Open
jbedard opened this issue Mar 13, 2024 · 2 comments

Comments

@jbedard
Copy link

jbedard commented Mar 13, 2024

ERROR: /.../external/build_stack_rules_proto/plugin/bufbuild/BUILD.bazel:5:29: error loading package '@build_stack_rules_proto//': cannot load '//rules:proto_gazelle.bzl': no such file and referenced by '@build_stack_rules_proto//plugin/bufbuild:protoc-gen-es'
ERROR: Analysis of target '//local/package/not/using/rules_proto failed; build aborted:

It seems to be from this load statement. Patching that statement to include the @build_stack_rules_proto// fixes it for me locally.

diff --git a/BUILD.bazel b/BUILD.bazel
index 006a1149..34a55a00 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,7 +1,7 @@
 load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
 load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
 load("@npm_ts_proto//:defs.bzl", "npm_link_all_packages")
-load("@//rules:proto_gazelle.bzl", "proto_gazelle")
+load("@build_stack_rules_proto//rules:proto_gazelle.bzl", "proto_gazelle")
 
 exports_files(["rules_proto_config.yaml"])

I can open a PR but haven't had time to actually reproduce it outside my private repo. I don't think I'm doing anything unique so I'm not sure why this hasn't been seen elsewhere?

@sacsar
Copy link

sacsar commented Apr 2, 2024

I have also hit this (again in a private repo) with Bazel 7.1.0. Are you using bzlmod? (I wonder if the meaning of @// changed.)

@jbedard
Copy link
Author

jbedard commented Apr 2, 2024

Yes, this is with 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

2 participants