cmd/go: go test
and go generate
add the wrong go
to $PATH
when the go
command is run from the cross-compiled bin
subdirectory
#64963
Milestone
Go version
dfb2e42
What operating system and processor architecture are you using (
go env
)?What did you do?
In a discussion with @matloob about #62114, I remembered the
$PATH
environment logic that I added togo test
andgo generate
for #51473 (comment).What did you expect to see?
If the
go
command is being run from$GOROOT/bin/$GOOS_$GOARCH
, as may be the case in multi-arch Go installations, the$PATH
setting used forgo generate
andgo test
should include that path.Compare:
go
command is run from the cross-compiledbin
subdirectory #62119What did you see instead?
The
$PATH
setting includes only$GOROOT/bin
:https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/base/env.go;l=41-45;drc=dfb2e4265bf7654001c77925dfbbb9c38c0d1a95
And the path used for looking up the current
go
command also checks only$GOROOT/bin
:https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/generate/generate.go;l=490;drc=dfb2e4265bf7654001c77925dfbbb9c38c0d1a95
The text was updated successfully, but these errors were encountered: