-
Notifications
You must be signed in to change notification settings - Fork 5k
Daemon auto-provisioning downloads toolchain from provided url #29166
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
Merged
ljacomet
merged 6 commits into
gradle:master
from
vmadalin:daemon-toolchain-auto-provisioning-download-toolchain
Jan 29, 2025
Merged
Daemon auto-provisioning downloads toolchain from provided url #29166
ljacomet
merged 6 commits into
gradle:master
from
vmadalin:daemon-toolchain-auto-provisioning-download-toolchain
Jan 29, 2025
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
There are new TODOs present in this change. Should any be removed? |
d580e6a
to
cd5bc8b
Compare
cd5bc8b
to
b7b9880
Compare
Change SummaryThis PR is 75.98% new code.
|
ab7d661
to
134a1cc
Compare
9 tasks
134a1cc
to
a9fced2
Compare
a9fced2
to
6714182
Compare
6714182
to
ce6d532
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The following builds have failed: |
fc3d3ac
to
5335b79
Compare
@bot-gradle test PT |
This comment has been minimized.
This comment has been minimized.
The following builds have failed: |
7f8ec77
to
ecf204c
Compare
…ureFileDownloader Signed-off-by: Madalin Valceleanu <[email protected]>
Moving higher is currently blocked by, at least, the transitive usage of `RepositoryTransportFactory` which is `Build` scoped. Fixes gradle#24353
This is no longer needed following refactors that enable using a DefaultToolchainSpec instead.
We cannot have such a dependency as it impacts classloading of Gradle core and plugins, breaking use cases due to the class loading hierarchy changes this causes. Instead classes needed for the daemon toolchain work were moved to logging or resources projects which are part of core.
The infrastructure needs to use launcher/daemon side events, that are then translated by the tooling API protocol. By reusing this infra, there is no need to update the TAPI client in IDEs to get the download events as long as the IDE already integrated with those events available since Gradle 7.3
ecf204c
to
29b1f6f
Compare
auto-merge was automatically disabled
January 29, 2025 15:49
Pull Request is not mergeable
Those services are only required when using the daemon tooclhain feature and no daemon is available. The lazy initializations makes sure only launchers in that configuration pay the price for those services creation.
29b1f6f
to
26211a0
Compare
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.
Context
The
Daemon toolchain auto-provisioning mechanism
is part ofPhase 2
oftoolchain support for Gradle Daemon
, where the motivation behind it and other technical details can be found on the public spec document. ThisPR adds the capability for the auto-provisioning mechanism to download the toolchain given the specified url on the
gradle/gradle-daemon-jvm.properties
, supporting as well local files.Here is the summary about the changes:
SecureFileDownloader
fromresources-http
on the Launcher by creating an abstraction forSecureFileDownloader.createExternalResource
calledExternalResourceFactory
allowing to have two different implementations for daemon and tasks toolchain, since this last one is using many services outside of the scope of the LauncherJavaToolchainQueryService
and its dependencies fromtoolchain-jvm
totoolchain-jvm-shared
so it can be reused from the launcherJavaToolchainQueryService
at a higher level #24353Global
andProject
for now since it requires a major refactor to keep justGlobal
, allowing to reuse this from the Launcher. The same approach has been taken forFileResourceListener
whereEventScope
now allows an array of scopes similar toServiceScope
to be able to supportFileResourceConnector
for local file urlsDaemonJavaToolchainQueryService
implementation by reusing theJavaToolchainQueryService
from the LauncherJavaToolchainSpec
calledDaemonJvmToolchainSpec
allowing to create it based onPropertyFactory
which is available on the Launcher. This is required forJavaToolchainQueryService.findMatchingToolchain
ProgressLoggerFactory
to display the downloading progress for the toolchainHttpResourceAccessor
instead ofUrlExternalResource
since the last one doesn’t return the metadata containing the file nameAbstractProgressLoggingHandler.ProgressLoggingInputStream
moved to separate file so it can be reusedProgressLoggingInputSteamListener
toProgressLoggingInputStream
to capture read operation progress instead of build specificResourceOperation
ToolchainDownloadProgressListener
which is responsible for sending proper everts to display downloading toolchain progress on theCLI
andTAPI
:DefaultToolingImplementationLoader
was modified to includeDownload
progress related events forTAPI
since this was causing them to be ignored due toclassloader
conflict causing forDefaultFileDownloadStartEvent
:NOTE: This change was built on top of #29022 to avoid merge conflicts.
Tests
Demo
Simple demo exposing how auto-provisioning mechanism download the daemon toolchain from the specified url or from a local file. Note that the error is because of missing installation part, which will be addressed separately
Daemon.toolchain.downloaded.by.auto-provisioning.mechanism.mov
Screen.Recording.2024-05-28.at.15.28.54.mov
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew sanityCheck
./gradlew <changed-subproject>:quickTest