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

Cache cleanup does not clean cache entries for newly released Gradle versions #436

Open
bigdaz opened this issue Nov 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bigdaz
Copy link
Member

bigdaz commented Nov 12, 2024

Gradle User Home cache cleanup requires Gradle 8.11 to execute.

  • If a version >= 8.11 is found on the PATH, then this version is used for cache-cleanup.
  • If no version is found on PATH (or an older version) then 8.11 will be downloaded and used.

If a Gradle Wrapper build runs with a newer version of Gradle (eg Gradle 8.11.1), then it will generate Gradle User Home content that will not be removed by cache cleanup running with Gradle 8.11.
For example, transform outputs are stored under ~/.gradle/caches/<gradle-version>/transforms, and caches/8.12/transforms will not be removed by cache-cleanup running with Gradle 8.11. This can result in ever-growing cache entry sizes.

To workaround this issue, ensure that there is a version of Gradle available on the PATH, and that this version is at least as new as any version used to run Gradle Wrapper builds.

uses: gradle/actions/setup-gradle@v4
with:
  gradle-version: "8.11.1" # Set to the newest version of Gradle used to build

Fixing this (without reverting to the old behaviour of always installing the latest Gradle) will involve detecting the newest Gradle version executed for a Job, and ensuring that cleanup is executed with at least that Gradle version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant