bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
85 stars 13 forks source link

Update following go modules to their newest proper version #91

Closed cjeker closed 1 year ago

cjeker commented 1 year ago
   golang.org/x/crypto v0.6.0
    golang.org/x/sys v0.5.0

Especially golang.org/x/sys needs to be kept up to date since systems do change over time. On OpenBSD anything using older golang.org/x/sys will soon have major issues because of syscall limitations.

0x4A6F commented 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.

qbit commented 1 year ago

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.

qbit commented 1 year ago

Hm, I see now that my error is different.

qbit commented 1 year ago

OK, to reproduce one can do:

git checkout v0.5.1
go mod vendor
go build -mod=vendor ./...
qbit commented 1 year ago

It seems the newer sys package requires a bump to be > go1.16.

benjojo commented 1 year ago

Weird, since the CI builds using 1.16

benjojo commented 1 year ago

image

Nevermind, clearly whatever is limiting the version in CI doesnt work