Closed cjeker closed 1 year ago
I'm getting following error trying to build 0.5.1 with go1.16 (as referenced in go.mod):
Building subPackage ./cmd/rtrdump
# golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/sys/unix/syscall_linux.go:2271:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/sys/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/sys/unix/sysvshm_unix.go:33:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
Setting go.mod to go1.17 and running go mod tidy
fixes this for me.
This seems to be related to different build modes:
qbit@europa[0]:~/src/stayrtr(tags/v0.5.1)% go build --mod=readonly ./...
qbit@europa[0]:~/src/stayrtr(tags/v0.5.1)% go build --mod=vendor ./...
go: inconsistent vendoring in /home/qbit/src/stayrtr:
github.com/google/go-cmp@v0.5.6: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/prometheus/client_golang@v1.11.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/sirupsen/logrus@v1.8.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
github.com/stretchr/testify@v1.4.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/crypto@v0.6.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
golang.org/x/sys@v0.5.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
To ignore the vendor directory, use -mod=readonly or -mod=mod.
To sync the vendor directory, run:
go mod vendor
qbit@europa[1]:~/src/stayrtr(tags/v0.5.1)%
readonly
works as expected.
Hm, I see now that my error is different.
OK, to reproduce one can do:
git checkout v0.5.1
go mod vendor
go build -mod=vendor ./...
It seems the newer sys package requires a bump to be > go1.16.
Weird, since the CI builds using 1.16
Nevermind, clearly whatever is limiting the version in CI doesnt work
Especially
golang.org/x/sys
needs to be kept up to date since systems do change over time. On OpenBSD anything using oldergolang.org/x/sys
will soon have major issues because of syscall limitations.