chore: provision toolchains with the foojay resolver - #18
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The foojay toolchain resolver is applied in settings, so Gradle can provision the JDK the
conventions ask for instead of requiring it to be installed already.
Why
kbuild sets
jvmToolchain(25), so building needs a JDK 25 toolchain. Without a resolver a machinethat lacks one stops at:
This only became worth doing with kbuild 1.2.10. Before it, the blocker was the Gradle daemon
JVM, which no resolver can provision; 1.2.10 emits Java 21 bytecode so the daemon floor is 21 again,
leaving the toolchain as the only requirement, and a toolchain can be downloaded.
It changes nothing where a JDK 25 is already present: Gradle prefers what it detects and only
downloads when nothing matches.
Testing
Verified against the case it is meant to fix, a machine with no JDK 25 in scope. Running on JDK 22
with an empty
GRADLE_USER_HOME,jvmTestpasses and Temurin 25.0.1 is provisioned into thathome rather than found:
Trade-off
Builds gain the ability to download JDKs, which some locked-down environments disallow. The
alternative is every developer installing JDK 25 by hand.