-
Notifications
You must be signed in to change notification settings - Fork 5k
Add support for custom toolchain provisioning #18028
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
Conversation
1c9b6fc
to
1b55127
Compare
I added a service to perform downloads of external resources via HTTP. This should make it even more trivial to implement toolchain provisioning. At this stage I think the PR is ready for review. |
1b55127
to
b5e65b2
Compare
@bot-gradle test QF |
OK, I've already triggered QuickFeedback build for you. |
56cc162
to
e830f30
Compare
@ljacomet Did you have time to discuss this internally? I'm open to chat if needed. |
There wasn't anything specific to AdoptOpenJDK in this class, which could be reused for other purposes. Signed-off-by: Cedric Champeau <[email protected]>
This commit refactors provisioning of Java toolchains, so that we can provide more provisioning services dynamically. For now, there's no public support for adding a provisioning service, so the only available service is the standard AdoptOpenJDK service. Signed-off-by: Cedric Champeau <[email protected]>
This commit allows plugin authors to register new provisioning services by the means of the `JavaToolchainService`. For now, lookup isn't fault tolerant, in the way that if a service provides candidates, and that it for whatever reason cannot provide the candidate, we wouldn't look for another provisioner. Signed-off-by: Cedric Champeau <[email protected]>
This commit adds a resource download service which can be used by toolchain provisioning to list, for example, available JDKs, then perform the download itself. The remote resource service honors the traditional offline mode and performs caching of resources. It's worth noting that toolchain provisioning calls the provisioning methods twice, but this isn't a new behavior: it's just exercised by this pull request, which adds tests with fake HTTP servers, highlighting this behavior. Signed-off-by: Cedric Champeau <[email protected]>
This caused an unexpected error: > SystemInfo is not supported on this operating system. Signed-off-by: Cedric Champeau <[email protected]>
e830f30
to
5cfb53c
Compare
Rebased onto |
This pull request has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be closed if no further activity occurs. If you intend to work on this pull request, please ask the team to reopen the PR or push a new PR. Thank you for your contributions. |
What is the status here, why is this still open, not merged, and now about to be closed? |
That's our stale bot being a bit too eager. We still want to offer something like that but different priorities had to be handled first and we are still discussing the exact design for this feature. |
Thanks. |
This pull request has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be closed if no further activity occurs. If you intend to work on this pull request, please ask the team to reopen the PR or push a new PR. Thank you for your contributions. |
ping |
This is for sure on the agenda in this form or another. |
Thanks, ping was for the stale bot ;) |
This pull request has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be closed if no further activity occurs. If you intend to work on this pull request, please ask the team to reopen the PR or push a new PR. Thank you for your contributions. |
Staling the auto-stale. We need this to really work. |
Relates to gradle/build-tool-roadmap#29 |
Is this still relevant now that #21082 is merged? |
I think this is still relevant in the sense that this PR fixes issue that the support included in 7.6 doesn't (e.g fixes on |
That's indeed super-useful! |
Closing this PR as a part of it is integrated already. |
What is the proper upvote mechanism (does a thumb up count 👍) |
yes, adding 👍 counts |
Context
The current Java toolchain mechanisms only allow downloading (provisioning) JDKs from AdoptOpenJDK. However, there are multiple JDKs which are available via different means, and could be automatically provisioned by Gradle too.
For this purpose, as discussed in Slack this pull request adds support for custom toolchain provisioning.
In a nutshell, a provisioning service is responsible for:
A plugin can then register such a provisioning service on the
toolchains
service. This would typically allow the GraalVM team to provide such a mechanism in the GraalVM native image plugin.IMPORTANT: For legal reasons, this pull request must not be merged until approved by @graemerocher
Some things that I noticed while working on this:
JvmImplementation
class is inconsistent with theJvmVendorSpec
class: it should in theory behave similarly: a spec should be provided, so that we can use other implementations thanJ9
. Currently, it's impossible to request something different thanJ9
, even if custom JDKs offer alternatives.JvmVendorSpec
has been updated so that we can query if a vendor matches the spec. Without this, it's barely impossible for a provisioner to tell if it's compatible or notJdkDownloader
with a more generic signature):RemoteResourceService
This should make it possible for projects like @joschi 's Java Metadata to provide a list of candidates based on the contents of the JSON file, and perform the download lazily.
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew sanityCheck
./gradlew <changed-subproject>:quickTest
Gradle Core Team Checklist