-
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
Remove deploy jar Java runtime dependency for non-executable targets #19140
Conversation
bc09e22
to
09ca59f
Compare
@hvadehra In case it's public, could you perhaps provide a bit more context on what is part of the hermetic runtime feature? I find it tricky to propose changes to the Java rules without (roughly) knowing how this is supposed to work. For example, depending on how this feature works, it could make more sense to guard the runtime dependency behind the value of |
|
I just checked that with this and bazelbuild/rules_java#114 and bazelbuild/rules_kotlin#1000, I can now build |
There's some background on the hermetic runtime feature here: https://mail.openjdk.org/pipermail/leyden-dev/2023-February/000107.html For the Java rules support, it's basically bundling a JDK into the |
@cushon Thanks for the pointer. What I find surprising is that the logic at https://github.com/bazelbuild/bazel/pull/19140/files#diff-ed65b74742411654fece564fdcfdb107625e42d1383d58b73ba32d0334896dcbL212 seems to run regardless of whether the |
It should be fine to disable that logic if The internal
|
@cushon Thanks for the confirmation. I am slightly worried about this line as it isn't conditional on I will push a new version that removes the runtime dependency if |
Good catch, I am preparing a fix for that
👍 |
09ca59f
to
f3de0ea
Compare
I pushed the new version. |
f3de0ea
to
93f5856
Compare
…bled As noticed by fmeum in #19140 (comment) PiperOrigin-RevId: 553198526 Change-Id: I47f0ae35c84508d4b64dc82f6f1058fe62c0d683
This allows deploy jars for `java_binary` targets with `create_executable = False` to compile for target platforms for which no standalone Java runtime is available (e.g. Android). Along the way, this removes a redundant check: `runtime.hermetic_files` is never `None`.
93f5856
to
0b3131e
Compare
@cushon I rebased onto your commit and simplified the implementation by using that |
This allows deploy jars for
java_binary
targets withcreate_executable = False
to compile for target platforms for which no standalone Java runtime is available (e.g. Android).Along the way, this removes a redundant check (
runtime.hermetic_files
is neverNone
) and ensures that files coming from the hermetic runtime are only added ifhermetic
is set toTrue
.Work towards #17085