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 should not run after configuration-cache reuse #19

Closed
bigdaz opened this issue Jan 13, 2024 · 0 comments
Closed

Cache cleanup should not run after configuration-cache reuse #19

bigdaz opened this issue Jan 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working in:cache-cleanup
Milestone

Comments

@bigdaz
Copy link
Member

bigdaz commented Jan 13, 2024

When setting gradle-home-cache-cleanup: true, the action will attempt to remove all unused files from Gradle User Home before saving the state.
When running a build with state loaded from the configuration-cache, many files in Gradle User Home (eg dependency jars) are not necessarily recorded as being used during the build.

Taken together, this means that after a successful build with configuration-cache reuse, the saved Gradle User Home will have no dependencies. This can result in a ClassNotFoundException failure in subsequent builds.

@bigdaz bigdaz transferred this issue from gradle/gradle-build-action Feb 9, 2024
@bigdaz bigdaz added the bug Something isn't working label Feb 9, 2024
@bigdaz bigdaz changed the title Cache cleanup incompatible with configuration-cache reuse Cache cleanup is incompatible with configuration-cache reuse Feb 9, 2024
@bigdaz bigdaz self-assigned this Jul 17, 2024
@bigdaz bigdaz changed the title Cache cleanup is incompatible with configuration-cache reuse Cache cleanup should not run after configuration-cache reuse Jul 17, 2024
bigdaz added a commit that referenced this issue Jul 19, 2024
When a build runs with config-cache reuse, many necessary files are not marked
as being used during the build execution. This means that subsequent cache-cleanup
may remove files that are required for subsequent builds.

This change disables cache-cleanup whenever a build runs with config-cache reuse.

Fixes #19
@bigdaz bigdaz closed this as completed in 7a630bc Jul 19, 2024
@bigdaz bigdaz modified the milestones: v3.6.0, v4.0.0 Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in:cache-cleanup
Projects
None yet
Development

No branches or pull requests

1 participant