You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go1.9.5, installed via the binary downloader, so that the GOROOT compiled into the runtime is /usr/local/go.
What did you do?
Not read the instructions, try to use vgo with Go 1.9.x:
$ go version
1.9.5
$ go get golang.org/x/vgo
$ vgo list
So vgo ends up installed in $GOPATH/bin/vgo, instead of in $GOROOT/bin/vgo, which would make the code in cfg.go that looks at exe/../.. to see if it is a GOROOT correctly trigger.
What did you expect to see?
A useful error, like the one implemented in vgo's main.go: log.Fatalf("vgo requires Go 1.10")
What did you see instead?
vgo objabi: open /usr/local/go/src/cmd/internal/objabi/zbootstrap.go: no such file or directory
vgo objabi: cannot find GOARM
A related problem was first reported and a fix was made in #23957.
It is happening because vendor/cmd/go/internal/cfg/cfg.go is running objabi() in the init context, so it happens before main.go's Go 1.10 check can happen. And objabi expects cfg.GOROOT to be set correctly, but in findGOROOT, the special case to convert runtime.GOROOT into the real location where the binary distribution was unpacked is not triggered because vgo is installed in $GOPATH/bin.
The text was updated successfully, but these errors were encountered:
A workaround is to set VGOROOT=$(go env GOROOT), so that zbootstrap.go is at least found, but then this overly aggressive error in objabi() still kills us:
This test appears to have been broken by https://golang.org/cl/104975.
Updates golang/go#24694.
Updates golang/go#25501.
Before:
~/src/golang.org/x/vgo/vendor/cmd/go$ go test -run=TestExecutableGOROOT .
--- FAIL: TestExecutableGOROOT (0.15s)
--- FAIL: TestExecutableGOROOT/RuntimeGoroot (0.00s)
go_test.go:4598: /tmp/gotest104327550/new/bin/go run testdata/print_goroot.go: exit status 1, vgo requires Go 1.10 but VGOROOT=/tmp/gotest104327550/new is not a Go 1.10 source tree
FAIL
FAIL golang.org/x/vgo/vendor/cmd/go 1.730s
After:
~/src/golang.org/x/vgo/vendor/cmd/go$ go test -run=TestExecutableGOROOT .
ok golang.org/x/vgo/vendor/cmd/go 2.870s
Change-Id: I155a1344ec704c53d3678390cafc1ad33d1a338b
Reviewed-on: https://go-review.googlesource.com/116615
Reviewed-by: Russ Cox <rsc@golang.org>
What version of Go are you using (
go version
)?go1.9.5, installed via the binary downloader, so that the GOROOT compiled into the runtime is /usr/local/go.
What did you do?
Not read the instructions, try to use vgo with Go 1.9.x:
So vgo ends up installed in $GOPATH/bin/vgo, instead of in $GOROOT/bin/vgo, which would make the code in cfg.go that looks at exe/../.. to see if it is a GOROOT correctly trigger.
What did you expect to see?
A useful error, like the one implemented in vgo's main.go: log.Fatalf("vgo requires Go 1.10")
What did you see instead?
A related problem was first reported and a fix was made in #23957.
It is happening because vendor/cmd/go/internal/cfg/cfg.go is running objabi() in the init context, so it happens before main.go's Go 1.10 check can happen. And objabi expects cfg.GOROOT to be set correctly, but in findGOROOT, the special case to convert runtime.GOROOT into the real location where the binary distribution was unpacked is not triggered because vgo is installed in $GOPATH/bin.
The text was updated successfully, but these errors were encountered: