-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Use java macros in java_tools. #8758
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that java_tools will fetch rules_java? Will rules_java be bundled in Bazel (even as a http_archive)?
I'm wondering if the direction shouldn't be reversed, rules_java should fetch java_tools, wdyt?
Yes, after a java_tools release containing this PR the java_tools will fetch rules_java.
Not necessarily. My plan was to migrate users to adding rules_java to their own WORKSPACE file. I'm trying to figure out the consequences of embedding
In theory they both need each other. I don't see how we can avoid adding a repository dependency on ruels_java from java_tools. Until we migrate the rules to Starlark it doesn't make much sense for rules_java to embed/use java_tools. |
@hlopko as discussed offline I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls mention in the cl description that:
This PR makes @rules_java available to every Bazel user, making #8746 a little bit less effective (people can forget to add rules_java into their WORKSPACE and use the @rules_java from workspace suffix. This is fine, we'll follow up with another incompatible change that removes both @rules_java and @java_tools from Bazel.
This PR does not prevent people from adding their own rules_java repository into the WORKSPACE file, so well-behaving users can safely migrate for #8746.
src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE
Outdated
Show resolved
Hide resolved
tools/jdk/WORKSPACE.java_tools
Outdated
@@ -0,0 +1,8 @@ | |||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |||
|
|||
http_archive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's jdk.WORKSPACE for and what's WORKSPACE.java_tools for? Do we need both of them to define rules_java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hlopko I removed WORKSPACE.java_tools because it's not needed if @rules_java
is in the workspace suffix.
jdk.WORKSPACE is the java specific part of the implicit workspace suffix.
WORKSPACE.java_tools was the WORKSPACE file of the java_tools repository (not required anymore)
@hlopko you can take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Do we need to tell users about @rules_java? :) They'll be better off if they put their own into their workspace.
`@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely migrate bazelbuild#8746. Progress on bazelbuild#8746. Closes bazelbuild#8758. PiperOrigin-RevId: 256347290
`@rules_java` repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely migrate bazelbuild#8746. Progress on bazelbuild#8746. Closes bazelbuild#8758. PiperOrigin-RevId: 256347290
@rules_java
repository is now available to all Bazel java users. There is the possibility to override the repository in the users' WORKSPACE file in order to safely migrate #8746.Progress on #8746.