Description
Description:
setup-go@v4 added /home/runner/.cache/go-build
caching, which does not take the OS version into account, as a result, cache saved from Ubuntu 22.04 can be used on Ubuntu 20.04, resulting in cryptic linker errors. Apparently, this issue is only happening with Go 1.19.x (I guess they've worked around that in Go 1.20, but am too lazy to take a look).
Found it by experimenting with adding Ubuntu 22.04 to github.com/opencontainers/runc CI matrix. Meaning, the tests are now run on BOTH Ubuntu 20.04 and 22.04, using both Go 1.19.x and 1.20.x. IOW, here's the test matrix, simplified:
jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
go-version: [1.19.x, 1.20.x]
runs-on: ${{ matrix.os }}
Once I managed to get it running, I started to see errors like these on Ubuntu 20.04:
/tmp/go-build2163232479/b244/fs.test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /tmp/go-build2163232479/b244/fs.test)
402
/tmp/go-build2163232479/b244/fs.test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/go-build2163232479/b244/fs.test)
403
FAIL github.com/opencontainers/runc/libcontainer/cgroups/fs 0.001s
# /home/runner/work/runc/runc/tests/integration/../../contrib/cmd/recvtty/recvtty: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/runner/work/runc/runc/tests/integration/../../contrib/cmd/recvtty/recvtty)
646
# /home/runner/work/runc/runc/tests/integration/../../contrib/cmd/recvtty/recvtty: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/runner/work/runc/runc/tests/integration/../../contrib/cmd/recvtty/recvtty)
By looking into setup-go logs for Ubuntu-20.04 + Go 1.19.x, I see:
Successfully set up Go version 1.19.x
/opt/hostedtoolcache/go/1.19.7/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.19.7/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Received 42348815 of 42348815 (100.0%), 122.0 MBs/sec
Cache Size: ~40 MB (42348815 B)
/usr/bin/tar -z -xf /home/runner/work/_temp/19eb924c-5cbd-4755-aed2-942e62a6e0e7/cache.tgz -P -C /home/runner/work/runc/runc
Cache restored successfully
Cache restored from key: setup-go-Linux-go-1.19.7-592beaece5e8c0bb8caa2c1fc405d1151913594bf8854051414226cfa9818852
go version go1.19.7 linux/amd64
Now, for Ubuntu 22.04 + Go 1.19.x I see:
Successfully set up Go version 1.19.x
/opt/hostedtoolcache/go/1.19.7/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.19.7/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Received 42348815 of 42348815 (100.0%), 44.4 MBs/sec
Cache Size: ~40 MB (42348815 B)
/usr/bin/tar -z -xf /home/runner/work/_temp/3aa24702-2318-4693-8622-514b8f2482cc/cache.tgz -P -C /home/runner/work/runc/runc
Cache restored successfully
Cache restored from key: setup-go-Linux-go-1.19.7-592beaece5e8c0bb8caa2c1fc405d1151913594bf8854051414226cfa9818852
go version go1.19.7 linux/amd64
💡 The issue here, as you can see, that the same cache is being used for Ubuntu 20.04 and 22.04.
Action version:
v4
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
1.19.x, 1.20.x
Repro steps:
See e.g. this test run: https://github.com/opencontainers/runc/actions/runs/4654779815/jobs/8236809130 (from opencontainers/runc#3820).
Expected behavior:
No cryptic linkers errors, cache being unique per OS distro.
Actual behavior:
See above.