-
Notifications
You must be signed in to change notification settings - Fork 535
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
Caching should use go.mod, not go.sum #478
Comments
Hello @peterbourgon, Thank you for creating this issue and we will look into it :) |
Note:
Is this not a suitable for a file to be used as a cache key? if some new file needs to be downloaded that the cache should be updated to include that new file. |
Unfortunately not, no. Again, go.sum isn't a lock file, and doesn't (necessarily) represent the actual dependencies used by the module. In fact, it doesn't even need to be committed! It exists purely to verify any dependencies fetched as part of the build process.
Just use go.mod and the problem is solved. And don't take my word for it: github.blog, etc. |
Update caching and use go.mod instead of go.sum as hashFile as discussed in actions/setup-go#478 (comment)
…mework/run-tests actions (#191) * Update caching in setup-go GHA Update caching and use go.mod instead of go.sum as hashFile as discussed in actions/setup-go#478 (comment) * Remove cache_key_id and use cache_version This makes sure that the same cache key is used everywhere unless cache_version is changed. * Remove download mods step This is unnecessary step. The mods are downloaded anyway and then cached at the end of a job * Do not cache go builds by default Go builds can be fast and do not rely on network. This will reduce cache size. * Restore cache_key_id * Update related GHA * Use local actions for run-tests * Update cache keys * Fix * Revert using local actions * Bump * Fix * Bring back test_download_vendor_packages_command * Remove cache_version as cache_key_id can include this * Make test_download_vendor_packages_command optional * Bump * Bump
Hello @peterbourgon, Thank you once again for creating this issue. We have analyzed using go.mod instead of go.sum for caching and identified the following key points:
We will check the feasibility of the requested implementation and consider it as a feature request once we receive some feedback. |
Thank you! |
The caching performed by All I know is that when I cache the I do see evidence that |
I also notice that when running |
El El mar, 10 de sep de 2024 a la(s) 1:30 a.m., Rémy Léone <
***@***.***> escribió:
… I also notice that when running go test or go build that many files are
downloaded each time. I don't think that setup-go is effective. For people
that are working at GitHub, do you have analytics about the github action
where setup-go is present?
—
Reply to this email directly, view it on GitHub
<#478 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AX4MPLDWJHAVTNMQDNFW2L3ZV2NYPAVCNFSM6AAAAABHPR27GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZZHA4DEOJYGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@aparnajyothi-y Any updates on this? |
go.sum is an append-only log of checksums, used to verify the integrity of modules downloaded during builds. It's essentially a manifest file (shasums) and not any kind of lock file (Cargo.lock). It doesn't represent the dependencies of the corresponding module in any meaningful sense. This dependabot issue goes into more detail.
Cache keys for Go modules need to be based on the (normalized) content of go.mod, not go.sum, in order to be useful.
The text was updated successfully, but these errors were encountered: