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 be used with --override_repository: cannot load '@@rules_java//java:repositories.bzl': no such file #244

Open
guw opened this issue Jan 23, 2024 · 2 comments

Comments

@guw
Copy link
Contributor

guw commented Jan 23, 2024

We are using rules_jvm without problems with this in the workspace:

load("@contrib_rules_jvm//:repositories.bzl", "contrib_rules_jvm_deps")

contrib_rules_jvm_deps()

load("@contrib_rules_jvm//:setup.bzl", "contrib_rules_jvm_setup")

contrib_rules_jvm_setup()

However, as soon as we add --override_repository= rules_jvm=/path/to/rules_jvm the build fails with:

ERROR: Error computing the main repository mapping: at /Users/.../.cache/bazel/.../external/contrib_rules_jvm/setup.bzl:4:6: cannot load '@@rules_java//java:repositories.bzl': no such file
Computing main repo mapping: 
    Fetching repository @@contrib_rules_jvm_deps; starting

Note, the outer build is running with --noenable_bzlmod (Bazel 7.0.1) because we have not migrated yet.

@shs96c
Copy link
Collaborator

shs96c commented Jan 23, 2024

The flag should be --override_repository=rules_jvm=/path/to/repository. If for some reason the build is using bzlmod (and I see from your comment you don't expect this to be the case), the flag is --override_module and it should work in the same way.

@guw
Copy link
Contributor Author

guw commented Jan 24, 2024

@shs96c Sorry, that was a typo on my end. We use --noenabled_bzlmod as given in the comment above. Not sure why it's not loading rules_java. Maybe it needs a maybe in contrib_rules_jvm_deps?

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