Build output caching does not key off the current module's source?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 673
- Avg merge
- 6d 28m
- Merged PRs (30d)
- 4
Description
IIUC, a job with cache enabled goes roughly like this (with defaults):
- (setup-go) restore: download and extract cache blob, keyed by (among other things)
go.sum - (user step) build something
- (setup-go) save: if cache has key, skip. Otherwise, make a cache blob containing the "module" cache (i.e. source code) the build cache at
~/.cache/go-build/and upload it with that key.
The key is:
const primaryKey = `setup-go-${platform}-${linuxVersion}go-${versionSpec}-${fileHash}`;
--- https://github.com/actions/setup-go/blob/main/src/cache-restore.ts#L34
But that doesn't include any inputs from the current module's source (other than go.sum)? So really, we're just caching the build outputs of the dependencies?
(Or to be more precise, we bundle all of ~/.cache/go-build, but only when go.sum changes. If we did a build of the current module, then the build cache will contain its build objects. But it will never get updated if only the source of the current module changed.)
It's unclear if this is intended or an oversight. The README.md definitely isn't explicit that the current module's source is not considered WRT to the cache key and whether a save needs to happen.
Also, I haven't really thought about it, but I'm not sure how cache test results play into this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/cache-restore.ts around line 34 and the README.md caching documentation. Trace how the cache key, ~/.cache/go-build contents, and save behavior relate to current-module source and cached test results. Done means the intended behavior is established and the implementation or documentation clearly reflects it, with relevant tests updated if applicable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, go, typescript
- Domain
- build-system, ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100