golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.66k stars 17.61k forks source link

proposal: cmd/go: make build cache trimming cutoff configurable #69879

Open matthalp opened 1 week ago

matthalp commented 1 week ago

Proposal Details

The current policy assumes that caching is being used by a single developer. However, there are scenarios where the cache is shared across multiple developers and the cache size accumulation can have meaningful impact.

For example, CI where there can be many developers contributing code in a single day and leveraging a shared cache (e.g. GitHub Actions Cache where there is a cache size limit and also time spent loading and saving the cache). In these cases, 5 days of cache accumulation can have meaningful impacts.

Thank you for your consideration!

matthalp commented 1 week ago

Another option that just came to mind is to expose cache trimming on the tool chain to be able to explicitly call it with various some configurability as well.

seankhliao commented 1 week ago

Consider also:

gabyhelp commented 1 week ago

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)