Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@bigdaz

Description

@bigdaz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions