-
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
Keep repackaged 'allmodules' and 'minimized' JDKs up to date #14785
Comments
@meisterT Why did we use prebuilt 'allmodules' and 'minimized' JDKs? Was it for shorten the total build time of Bazel? |
I think one of the reasons was that the repackaged JDK is significantly smaller, which makes the bazel installer smaller:
|
There are two main reasons: it really takes quite a while (multiple minutes) so you don't want to do this on every build. Secondly, it is unfortunately non-deterministic. So it throw all caching out of the window. |
Oh, I understand why we are embedding the repacked JDK, but I'm asking the same question as yours: why not "create them at build-time instead." |
@meisterT I see.. |
Do we know why it is non-deterministic? |
How are the allmodules JDKs used at this point? I remember some history from when the embedded JDK could be used by other tools that ran during the build, which might need modules Bazel doesn't. Is that still supported, or is everything else using local or remote JDKs instead of the embedded one? |
re non-determinism: when I last looked into it, the re allmodules JDK: that's a good question, and your recollection of history matches mine. I hope @comius knows the answer whether / how it is used today. |
re allmodules JDK: I hope @comius knows the answer whether / how it is used today. I don't. I would need to investigate. |
I found some internal discussion about allmodules from 2019 that included
That matches my recollection that I'm not sure there's a reason to keep the allmodules JDK around at this point. The vanilla remote JDKs seem to be fine for the JDKs that are used in toolchains. I think it's worth considering dropping it, unless we discover it's still being used for something important.
If the non-determinism is the main blocker and you're interested in generating these during the build, I can try to help chase that down. It sounds like something we ought to be able to upstream a fix for. |
I did look into the time it takes to minimize the JDK and it it is less than 15s on my laptop so I guess if we can fix the non-determinism we can actually get rid of the cached version. |
Fixing the non-determinism sounds great! |
BTW, I'm wondering how does Bazel know the action is non-deterministic and then decide to throw away the cache? Update: Oh I guess the output of |
Right, the output of |
Did you verify you're still seeing non-determinism from |
Yep, it's still there:
|
The jlink reproducibility issues have been fixed in JDK 16:
@meisterT what do you think about trying to use JDK 17 as the embedded JDK? Since the JDK is packaged in Bazel, and only used by Bazel, I don't think that would necessarily be an invasive or user-visible change. |
Great! I think it's reasonable to update to JDK17. |
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
This allows removing the "cached" allmodules and minimized jdk archives, since `jlink` is deterministic in newer JDK versions. Fixes bazelbuild#14785.
[This is a continuation of discussion in internal review cl/427236699]
095f1e2 consolidated the handling the versions of remote JDKs referenced in Bazel in
distdir_deps.bzl
, as a follow-up to b741116.The only exception are the 'minimized' and 'allmodules' JDKs that are used for Bazel's embedded JDK:
bazel/WORKSPACE
Lines 135 to 141 in 06a3d82
bazel/WORKSPACE
Lines 148 to 153 in 06a3d82
Those JDKs are currently out of sync with the other versions.
They should be updated, and if possible the process for creating those derived JDKs should be improve to keep them in sync with the other versions instead of requiring manual updates. It would be nice if it was possible to create them at build-time instead.
The current process uses:
The text was updated successfully, but these errors were encountered: