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
Delete distribution zip file after installing from the wrapper #19495
Conversation
Sorry, I'm unable to see/understand what failed there. |
@altrisi Sorry for the confusion. The failure is here. You should be able to log in with a guest account. For future reference, let me know if it doesn't work. The stacktrace is below:
I've quickly fixed the problem on your branch, see the commit message for the explanation. Feel free to squash commits and remove my face from your feature branch. :) |
Sorry for the delay, been busy with exams, will take a look later to see why the test failed (though I don't see how could that have changed because of the changes here). Will also refactor it to match the new project structure and run tests again. |
@ljacomet I've built a local distribution with the changes and verified the integrity of the wrapper download. If I execute two builds with the same wrapper, the first build triggers the distribution download while the second one waits idle. Once the download finishes, both build start in parallel. |
Requesting a review from the @gradle/bt-core team as I'm not confident that this PR can be merged. |
Oh yeah, I'd have to check whether this is compatible after the recent wrapper changes, which I haven't yet. However, I don't really have time right now so feel free to check by yourselves, it's a really trivial change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donat This seems like a good idea to me
@bigdaz does this impact the GH action at all? |
Yes it will require changes to the GH action. Currently, the action will save/restore the downloaded wrapper zip and not the extracted install: https://github.com/gradle/gradle-build-action/blob/main/src/cache-extract-entries.ts#L313-L314. (Note we do something similar for java toolchains). That said, I'm OK with changing this in |
To save space, future versions of Gradle are likely to delete the downloaded distribution after extracting it. See gradle/gradle#3605 and gradle/gradle#19495. To cater for this we will now save/restore the extracted distribution rather than the downloaded zip file.
To save space, future versions of Gradle are likely to delete the downloaded distribution after extracting it. See gradle/gradle#3605 and gradle/gradle#19495. To cater for this we will now save/restore the extracted distribution rather than the downloaded zip file.
@big-guy I've now adapted the |
Is this accepted then? If so, what would be missing for a merge? To me it seems only remaking the wrapper hash, but want to be sure to not have to redo it more times. Would also need to know if there's some specific way to generate it or if I should just get the hash of a built jar, given there's no instructions on how to set that field (or that it should be changed even) in the contributing files. I can probably finish it next week then (or feel free to just change the hash and merge if it's all that's needed). |
I have updated the wrapper's hash with the result of Is there anything else missing? Other than telling bot-gradle to test this, that I don't think I can do. |
We'll take it from here. |
Signed-off-by: altrisi <altrisi.trillosierra@gmail.com>
@bot-gradle test and merge |
No milestone for this PR. Please set a milestone and retry. |
@bot-gradle test and merge |
OK, I've already triggered a build for you. |
Just curious, was this really meant to go in as far as 7.6 RCs? I feel like it's been ages since this change was merged (way more since submitted) and it still isn't in a release, being such a trivial change... |
Fixes #19480, fixes #3605.
Context
Each gradle distribution zip uses around (recently over) 100MB (110MB for 7.3). If you update the gradle installation in projects regularly via the wrapper, this can fill up your drive with lots of unnecessary data, given the extracted files are next to it and the zip isn't ever used again for anything.
This PR also removes the line in the tests that checks for the zip to be present, given it's not actually needed to reuse the distribution (only the ok file is). You can see an image of gradle launching without the zip here.
Contributor Checklist
<subproject>/src/integTest
) to verify changes from a user perspective<subproject>/src/test
) to verify logic./gradlew sanityCheck
./gradlew <changed-subproject>:quickTest
Tests also ran in an action runner in https://github.com/altrisi/gradle/actions/runs/1658407331.
Gradle Core Team Checklist
Signed-off-by: altrisi altrisi.trillosierra@gmail.com