lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Copr builds fail on some distro lacking go 1.18

Open ofavre opened this issue 3 years ago • 0 comments

A clear and concise description of what the bug is. In Copr some builds fail: latest 4685323 build

  • epel-7-x86_64
  • epel-8-x86_64
  • epel-9-aarch64
  • epel-9-x86_64
  • fedora-35-aarch64
  • fedora-35-x86_64

Here are the logs for the last one: https://download.copr.fedorainfracloud.org/results/atim/lazygit/fedora-35-x86_64/04685323-lazygit/build.log.gz

# golang.org/x/exp/constraints
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:13:2: invalid character U+007E '~'
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:13:7: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:20:2: invalid character U+007E '~'
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:20:8: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:27:9: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:34:2: invalid character U+007E '~'
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:34:11: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:41:2: invalid character U+007E '~'
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:41:13: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:49:10: syntax error: unexpected |, expecting semicolon or newline or }
../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go:49:10: too many errors
note: module requires Go 1.18
# github.com/jesseduffield/generics/maps
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:3:10: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:11:12: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:19:21: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:20:42: syntax error: unexpected comma, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:29:19: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:30:27: syntax error: unexpected ] after top level declaration
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:37:16: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:37:92: method has multiple receivers
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:38:18: syntax error: unexpected ] after top level declaration
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:45:12: syntax error: unexpected [, expecting (
../../../go/pkg/mod/github.com/jesseduffield/[email protected]/maps/maps.go:45:12: too many errors
note: module requires Go 1.18

The file ../../../go/pkg/mod/golang.org/x/[email protected]/constraints/constraints.go at line 13 contains this:

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

I guess if your go.mod file says go 1.17 instead of go 1.18 you'll have more luck with it choosing non go 1.18-only modules. You can test compiling using go 1.17 too.

Or you can make sure that you are using a specific version of go instead of relying on the system's version. Maybe these commands would do the trick:

go get golang.org/dl/go1.18
go1.18 download

Then use go1.18 instead of plain go for building.

Keep up the good work! Cheers.

ofavre avatar Jul 26 '22 10:07 ofavre