Skip to content
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

Add persistent cache for toolchain auto-detection mechanism #28966

Open
wants to merge 1 commit into
base: release
Choose a base branch
from

Conversation

vmadalin
Copy link
Contributor

@vmadalin vmadalin commented Apr 25, 2024

Context

The Daemon toolchain auto-detection mechanism is part of Phase 1 of toolchain support for Gradle Daemon, where the motivation behind it and other technical details can be found on the public spec document. This PR implements the persistent cache for the toolchain auto-detection mechanism by adding indexed cache on CachingJvmMetadataDetector storing the JvmInstallationMetadata resolved object based on toolchain installation path. This cache is a VersionStrategy.CachePerVersion allowing to have a separate cache instance for each Gradle version that are stored under Gradle User Home directory.

Testing

Unit tests:

Integration tests

Demo

Simple demo exposing how persistent cache for toolchain auto-detection mechanism works:

Daemon.toolchain.auto-detection.cache.mov

Contributor Checklist

  • Review Contribution Guidelines
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
  • Provide unit tests (under <subproject>/src/test) to verify logic
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes
  • Ensure that tests pass sanity check: ./gradlew sanityCheck
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest

@bot-gradle bot-gradle added from:contributor PR by an external contributor to-triage labels Apr 25, 2024
@vmadalin vmadalin force-pushed the feature/daemon-toolchain-auto-detection-cache branch from 63635ad to 4a380c9 Compare April 25, 2024 16:05
@vmadalin vmadalin changed the base branch from master to release April 26, 2024 08:50
@vmadalin vmadalin force-pushed the feature/daemon-toolchain-auto-detection-cache branch 2 times, most recently from 1fb0d6d to 7671ab2 Compare April 28, 2024 18:49
…ector

Signed-off-by: Madalin Valceleanu <vmadalin@google.com>
@vmadalin vmadalin force-pushed the feature/daemon-toolchain-auto-detection-cache branch from 7671ab2 to 8777b5f Compare April 28, 2024 21:00
Copy link

gitstream-cm bot commented Apr 28, 2024

Change Summary

This PR is 79.24% new code.
Platform Added Lines % of Total Line Changes Deleted Lines % of Total Line Changes Files Changed % of Total Files Changed
bt_ge_build_cache 0 0% 0 0% 0 0%
build_infrastructure 0 0% 0 0% 0 0%
core_configuration 0 0% 0 0% 0 0%
core_execution 55 9.93% 1 0.18% 2 9.52%
core_runtime 55 9.93% 1 0.18% 2 9.52%
documentation 0 0% 0 0% 0 0%
extensibility 0 0% 0 0% 0 0%
gradle_enterprise 0 0% 0 0% 0 0%
ide 0 0% 0 0% 0 0%
jvm 347 62.64% 104 18.77% 13 61.9%
kotlin_dsl 0 0% 0 0% 0 0%
release_coordination 0 0% 0 0% 0 0%
software 0 0% 0 0% 0 0%

@vmadalin vmadalin marked this pull request as ready for review April 28, 2024 21:11
@vmadalin vmadalin requested review from a team as code owners April 28, 2024 21:11
@vmadalin vmadalin requested a review from tresat April 28, 2024 21:11
@vmadalin
Copy link
Contributor Author

This PR requires to be able to reuse the GlobalScopedCacheBuilderFactory on the JvmInstallationMetadata as part of jvm-services used from the launcher. However, this isn't longer possible due to #28582 changes that moved the persistent-cache to core. Meaning that before merging this PR is required to address to make the mentioned class accessible. CC: @lptr , @big-guy

@ov7a ov7a added in:daemon 👋 team-triage Issues that need to be triaged by a specific team and removed to-triage labels Apr 29, 2024
@big-guy big-guy added this to the 8.9 RC1 milestone May 6, 2024
@big-guy big-guy self-assigned this May 6, 2024
@big-guy big-guy removed the 👋 team-triage Issues that need to be triaged by a specific team label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:contributor PR by an external contributor in:daemon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants