Skip to content

Commit

Permalink
Disable setup-go cache to avoid warnings
Browse files Browse the repository at this point in the history
When cache is enabled we always get warnings from tar:

    usr/bin/tar: ../../../go/pkg/mod/golang.org/x/telemetry/[email protected]/doc.go: Cannot open: File exists
    /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/telemetry/[email protected]/LICENSE: Cannot open: File exists
    /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/telemetry/[email protected]/config.json: Cannot open: File exists
    /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/telemetry/[email protected]/go.mod: Cannot open: File exists
    /usr/bin/tar: Exiting with failure status due to previous errors
    Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2

According to setup-go issue[1] the mitigation is to disable the cache.

Strangely, when the cache is disabled, the setup-go step is adding go to
the cache:

    Adding to the cache ...
    Successfully cached go to /opt/hostedtoolcache/go/1.23.0/x64

[1] actions/setup-go#403
  • Loading branch information
nirs committed Aug 22, 2024
1 parent 559436a commit d766ed1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Build binary
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build

0 comments on commit d766ed1

Please sign in to comment.