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

Upgrade rules_java and add rule loads #1271

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

ted-xie
Copy link
Contributor

@ted-xie ted-xie commented Oct 24, 2024

  • Upgrade to the latest rules_java 8.1.0
  • Add loads for Java rules

NOTE: The loads and rules_java version unforutunately are tightly related. The paths for the bzl files for Java rules changed between rules_java 7 and 8.

* Upgrade to the latest rules_java 8.1.0
* Add loads for Java rules

NOTE: The loads and rules_java version unforutunately are tightly
related. The paths for the bzl files for Java rules changed between
rules_java 7 and 8.
@ted-xie
Copy link
Contributor Author

ted-xie commented Oct 24, 2024

For some more context on the rule loads: This PR is supposed to make rules_jvm_external work with Bazel 8, which removes all native Java rule loads.

Most users will be able to upgrade to Bazel 8 without manually adding all of these loads for Java rules. The exception is rule repository maintainers -- I'm not sure of the specifics, but it looks like rule reposotiries (rules_java, rules_android, etc) are special-cased, and autoloads from other rule repositories are disabled.

I was motivated to write this PR when trying to get rules_android to work with Bazel 8. Because I'm working inside a rule repo, it looks like transitive repo deps are not autoloaded -- for example, rules_jvm_external's use of java_library/java_import rules.

For more context on why rules_java 8.1.0: rules_java v8 changed where symbols such as java_binary and JavaInfo are loaded from. The old paths to various .bzl files seem to no longer exist, or at least are no longer visible.

@ted-xie
Copy link
Contributor Author

ted-xie commented Oct 24, 2024

/cc @comius

@jin jin merged commit 305848d into bazel-contrib:master Oct 28, 2024
7 checks passed
@jin
Copy link
Collaborator

jin commented Oct 28, 2024

Wait, did you forget to update MODULE.bazel?

@ted-xie
Copy link
Contributor Author

ted-xie commented Oct 28, 2024

Ah, my main repository already had rules_java bumped to 7.12.2 so I forgot I had to update it in RJE too. I see you already updated RJE's MODULE.bazel in 3ea9649. I think that should be sufficient.

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

Successfully merging this pull request may close these issues.

2 participants