-
Notifications
You must be signed in to change notification settings - Fork 73
Error in subrule: file '@@rules_java~//java/common/rules:android_lint.bzl' cannot use private API #233
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
Comments
You'll need to use the flag |
Thanks @hvadehra - however I think it's not a great practice for a Semver-stable ruleset to require experimental features for the LTS version of Bazel. It's not fair to describe an experiment as something required for production use. Could you instead use |
* chore(deps): update dependency rules_java to v8 * Add required flag See bazelbuild/rules_java#233 * Update .bazelrc --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alex Eagle <[email protected]>
I'm not sure how semver applies here. This incompatibility was introduced while moving from v7 to v8. rules_java 8.x is intended for use with Bazel 8 onwards. While it is possible to use with older Bazel versions, it may need some flag flips / patching. Unfortunately, we can't bump the Bazel compatibility version beforehand because it's a chicken-and-egg situation with updating this in Bazel. This problem could go away once Bazel itself no longer bundles rules_java. That said, this is coming up often enough, that I suppose this warrants a note in the README / release notes.
Since Bazel performs eager evaluation of all transitively loaded bzl files, the TLDR: For Bazel version N, use rules_java N |
That's not strictly true: |
So let us say the requirement is:
where loading |
You could add a repo rule to rules_java that writes one of the two But if this is just about If you want, I can send a PR, I would just need references to the two versions of the rules. |
It's not just the |
Both the call and the If you really do need conditional loads (I think you don't), adding your own repo rule would be the easiest solution. |
Understood. The repo rule approach is probably better. The alternative will just add clutter to the definitions which would anyways be unusable with older Bazel versions. |
Update, rules_java 8.3.0 is available that does not suffer from this problem. |
Awesome, thanks so much! |
This flag no longer needed, see bazelbuild/rules_java#233 (comment)
This flag no longer needed, see bazelbuild/rules_java#233 (comment)
Uh oh!
There was an error while loading. Please reload this page.
It is currently impossible to use rules_java >= 8.0.0 with Android.
Was broken by 2c8f7f4
Works in rules_java 7.12.1, does not work in 8.0.0
Reproduction steps:
bazel build //...
Output:
The text was updated successfully, but these errors were encountered: