jesseduffield / jesseduffield/lazygit

Copr builds fail on some distro lacking go 1.18

Open
#2,055 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

A clear and concise description of what the bug is.
In Copr some builds fail: [latest 4685323 build](https://copr.fedorainfracloud.org/coprs/atim/lazygit/build/4685323/)

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

The file `../../../go/pkg/mod/golang.org/x/exp@v0.0.0-20220318154914-8dddf5d87bd8/constraints/constraints.go` at line 13 contains this:

```go
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.