Skip to content

ci/actions/go-setup: Use vendor.sum as go.sum#47428

Closed
vvoland wants to merge 1 commit intomoby:masterfrom
vvoland:ci-setupgo-gosum-path
Closed

ci/actions/go-setup: Use vendor.sum as go.sum#47428
vvoland wants to merge 1 commit intomoby:masterfrom
vvoland:ci-setupgo-gosum-path

Conversation

@vvoland
Copy link
Copy Markdown
Contributor

@vvoland vvoland commented Feb 22, 2024

actions/go-setup tries to restore the go cache, but expects to read the go.sum which we don't have:

Run actions/setup-go@v5
...
Found in cache @ /opt/hostedtoolcache/go/1.21.7/x64
...
/opt/hostedtoolcache/go/1.21.7/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.21.7/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Warning: Restore cache failed: Dependencies file is not found in /home/runner/work/moby/moby. Supported file pattern: go.sum

Make it use vendor.sum instead.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

actions/go-setup tries to restore the go cache, but expects to read the
`go.sum` which we don't have:
```
Run actions/setup-go@v5
...
Found in cache @ /opt/hostedtoolcache/go/1.21.7/x64
...
/opt/hostedtoolcache/go/1.21.7/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.21.7/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Warning: Restore cache failed: Dependencies file is not found in /home/runner/work/moby/moby. Supported file pattern: go.sum
```

Make it use `vendor.sum` instead.

Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/testing area/performance labels Feb 22, 2024
@vvoland vvoland self-assigned this Feb 22, 2024
@thaJeztah
Copy link
Copy Markdown
Member

Do we know what it's trying to restore? Given that we use vendoring, I'm wondering what module cache it would try to use outside of that. If there's none, perhaps we need to disable the cache 🤔

@vvoland
Copy link
Copy Markdown
Contributor Author

vvoland commented Feb 22, 2024

It also restores the go build cache (go env GOCACHE). Basically it's using the hash of go.sum file to make a cache key, so the cache is invalidated whenever go.sum changes.

@vvoland
Copy link
Copy Markdown
Contributor Author

vvoland commented Feb 22, 2024

I don't see any meaningful impact on the jobs execution time though. So maybe we can just disable that..

@vvoland vvoland closed this Sep 3, 2024
@thaJeztah
Copy link
Copy Markdown
Member

Heh; just had this PR open in my browser; wondering if we should indeed go for disabling the cache to reduce some noise (or did we do so already?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/performance area/testing kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

Development

Successfully merging this pull request may close these issues.

2 participants