vikunja icon indicating copy to clipboard operation
vikunja copied to clipboard

fix: align go version

Open dpschen opened this issue 10 months ago • 8 comments

We have currently these logs in the ci when calling setup-go, see https://github.com/actions/setup-go/issues/424.

/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/LICENSE: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/CONTRIBUTING.md: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/README.md: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/time/mkzip.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/time/zoneinfo.zip: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/time/update.bash: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/time/README: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/fips140/Makefile: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/fips140/README.md: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/fips140/v1.0.0.zip: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/fips1[40](https://github.com/go-vikunja/vikunja/actions/runs/14217174464/job/39836464695#step:3:41)/fips140.sum: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/golang.org/[email protected]/lib/wasm/go_js_wasm_exec: Cannot open: File exists

This might be the related issue https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file

If I understand this correctly, the go version isn't read out of the go.mod file by default (instead the runner default is used).

dpschen avatar Apr 02 '25 10:04 dpschen

@kolaente In order to test this, this needs to re-run, since the caches weren't full in the first run.

Currently I'm not able to trigger that.

dpschen avatar Apr 02 '25 12:04 dpschen

I've triggered it now.

kolaente avatar Apr 02 '25 12:04 kolaente

Since there is still a cache hit for a newer go version I'm still not sure if this change is working.

@kolaente Could you clear the cache?

dpschen avatar Apr 02 '25 12:04 dpschen

@dpschen Done and re-triggered the workflow, we'll see

kolaente avatar Apr 02 '25 15:04 kolaente

@dpschen Done and re-triggered the workflow, we'll see

Well unsure now. Seems like it's still hitting the cache: https://github.com/go-vikunja/vikunja/actions/runs/14217874844/job/39858342713#step:5:24

But it's not matching. Any ideas? Else I guess we'll just dismiss this.

dpschen avatar Apr 02 '25 18:04 dpschen

Maybe because the action does not use the version read from go.mod to construct the cache key? That would be a bug in the action.

In any case, I think this is fine. The step runs in 13s, which is pretty fast already.

kolaente avatar Apr 02 '25 20:04 kolaente

Do you mean with this change or as it was before. Because how I understand it: the cache is not used, but at the same time the correct go version is used with this PR.

dpschen avatar Apr 06 '25 09:04 dpschen

With this change, it takes 13s. On current main, it takes 8s. I'm unsure if this is worth putting much effort into, if it is solely about caching.

However, I think we should use the go version that's specified in the go.mod file.

Maybe this is worth filing an issue with the action repo?

kolaente avatar Apr 09 '25 16:04 kolaente