alexei-led / pumba

Chaos testing, network emulation, and stress testing tool for containers
Apache License 2.0
2.75k stars 193 forks source link

0.9.7 does not get build with go 1.19.5 #237

Closed aminvakil closed 1 year ago

aminvakil commented 1 year ago

Upon building package which is getting run like this:

export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
make

It produces these errors:

# golang.org/x/sys/unix
/home/devel/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall_linux.go:2255:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/sysvshm_unix.go:33:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
# golang.org/x/exp/constraints
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:13:2: embedding interface element ~int|~int8|~int16|~int32|~int64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:20:2: embedding interface element ~uint|~uint8|~uint16|~uint32|~uint64|~uintptr requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:27:2: embedding interface element Signed|Unsigned requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:34:2: embedding interface element ~float32|~float64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:41:2: embedding interface element ~complex64|~complex128 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/devel/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:49:2: embedding interface element Integer|Float|~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
# github.com/golangci/gofmt/gofmt
/home/devel/go/pkg/mod/github.com/golangci/gofmt@v0.0.0-20220901101216-f2edd75033f2/gofmt/gofmt.go:195:49: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)

More info: https://github.com/aminvakil/aur/actions/runs/3903851608/jobs/6668805530#step:11:81

alexei-led commented 1 year ago

Just run make to build pumba locally or remove -mod=readonly flag. What problem are you trying to solve by adding this flag?

aminvakil commented 1 year ago

These flags are suggested by Arch Linux packaging guidelines. https://wiki.archlinux.org/title/Go_package_guidelines#Flags_and_build_options

FYI after removing -mod=readonly flag, I faced this error: -buildmode=pie not supported when -race is enabled https://github.com/aminvakil/aur/actions/runs/3907052312/jobs/6675857818#step:11:100

Removing -buildmode=pie fixed this error as well and package got build successfully, thanks!