tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
206 stars 11 forks source link

make dev error: version "go1.21.1" does not match go tool version "go1.21.0" #72

Closed r-o-b-b-y closed 5 months ago

r-o-b-b-y commented 5 months ago

I am currently on go version 1.21.1 and it may be causing some issue with some of the packages. (you'll have to excuse me I am not an expert in go dep and version management at the moment)

make dev is causing the error below. Running make dev again, fixes it.

Alternatively using GOTOOLCHAIN=go1.21.1 make dev makes it run on the first try, but this feature is only available in go1.21+ - Which I will assume is OK, since go.mod has this project at version 1.21.1

❯ go version
go version go1.21.1 darwin/arm64
❯ make dev
cd kernel && GOOS=js GOARCH=wasm go build -ldflags="-X 'main.Version=0.1' -X 'tractor.dev/wanix/kernel/fs.DebugLog=false'" -o ../local/bin/kernel .
cd shell && GOOS=js GOARCH=wasm go build -o ../local/bin/shell .
cd build && go run ./build-pkgs/main.go ./build-pkgs/imports ./pkg.zip
Building target js_wasm...
Building target darwin_amd64...
Building compile.wasm...
# internal/unsafeheader
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/godebugs
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/goexperiment
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/coverage/rtcov
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/goarch
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/goos
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/race
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/cpu
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# unicode
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# unicode/utf8
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/itoa
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# math/bits
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# sync/atomic
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# encoding
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# log/internal
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# runtime/internal/atomic
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/platform
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# unicode/utf16
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/goversion
compile: version "go1.21.1" does not match go tool version "go1.21.0"
# internal/coverage
compile: version "go1.21.1" does not match go tool version "go1.21.0"

FATAL: exit status 1
exit status 1
make: *** [build/pkg.zip] Error 1
❯ go version
go version go1.21.1 darwin/arm64
progrium commented 5 months ago

Great find! @Parzival-3141 are you able to reproduce?

progrium commented 5 months ago

@robby-robby do you happen to possibly have multiple versions of Go installed?

progrium commented 5 months ago

ok, i see that this new GOTOOLCHAIN nonsense breaks some assumptions about determining what you have installed and where. so we'll update our code to accommodate this and report back

taramk commented 5 months ago

"I think I can just set GOTOOLCHAIN=local instead of 1.21.1 that should default to whatever version you have installed, i.e. your GOROOT" - Julian

r-o-b-b-y commented 5 months ago

@robby-robby do you happen to possibly have multiple versions of Go installed?

I DO, is that bad?

I blew all other go versions away and installed the latest (1.21.6), this fixes, it makes without any special flags.

I am admittedly not a go packaging and versioning pro (sorry!)

Might I suggest adding a Dockerfile, to the repo (I will glady contribute) - That way there can be a fallback 'sanity check' for proper environment setups

progrium commented 5 months ago

Dockerfile is not a bad idea. Regardless, it looks like we just need to work out proper use of the new toolchain stuff. Then it shouldn't matter if you have multiple versions.