mitranim / gow

Missing watch mode for Go commands. Watch Go files and execute a command like "go run" or "go test"
The Unlicense
772 stars 29 forks source link

Could not install gow on golang:1.18 image #35

Closed Kuwerin closed 1 year ago

Kuwerin commented 1 year ago

It worked OK ~2 weeks ago, now it is not

docker run --rm --platform linux/amd64 golang:1.18-alpine go install github.com/mitranim/gow@latest

Expected

Successful installation

Got

go: downloading github.com/mitranim/gow v0.0.0-20230818075021-e50a405cdbc4
go: downloading github.com/mitranim/gg v0.1.19
go: downloading golang.org/x/sys v0.0.0-20210917161153-d61c044b1678
go: downloading github.com/rjeczalik/notify v0.9.3
# github.com/mitranim/gow
pkg/mod/github.com/mitranim/gow@v0.0.0-20230818075021-e50a405cdbc4/gow_main.go:112:13: internal compiler error: assigning gg.self (type gg.Chan[syscall.Signal]) to parameter gg.tar (type go.shape.chan int_0)
mitranim commented 1 year ago

Probably requires Go higher than 1.18. This looks like one of the compiler bugs that got fixed in later versions.

Kuwerin commented 1 year ago

Probably requires Go higher than 1.18. This looks like one of the compiler bugs that got fixed in later versions.

Yeah, but it worked before. Now it works ok with non-alpine versions and higher than 1.18 as well

UPD: I got the same problem trying to re-install gow on macos(go version=1.18). The problem was solved only after update go version

mitranim commented 1 year ago

I try my best to keep gow backwards compatible to avoid exactly this situation, with the exception of occasionally raising the required Go version. The reason you got such an obscure error is because one of the dependencies actually requires Go 1.20, but I forgot to update gow go.mod, which still requires Go 1.18. Just pushed a fix for this. It should at least tell you to update Go. Updating to Go 1.18 was necessary for generics (programming with generics is much easier than without), and updating to Go 1.20 was necessary for compiler fixes related to generics. I don't expect to be raising the version requirement in the near future unless the devteam comes out with something very tempting. My apologies for the breakage. You can also "fix" the gow version (as commit hash) in your install command to ensure future gow updates don't break your setup.