]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] cmd/go: find GOROOT using os.Executable when installed to...
authorBryan C. Mills <bcmills@google.com>
Fri, 18 Aug 2023 19:38:44 +0000 (15:38 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 30 Aug 2023 21:25:08 +0000 (21:25 +0000)
commit6385a6fb18cc2c2080d6d8c008c49e1cf20e04a0
tree69c0fdbf8d701a43d7a470c434ff18487bb6472f
parent2d07bb86f0a2bab639c51baca4c3cf6d9c4374ad
[release-branch.go1.21] cmd/go: find GOROOT using os.Executable when installed to GOROOT/bin/GOOS_GOARCH

When running make.bash in a cross-compiled configuration
(for example, GOARCH different from GOHOSTARCH), cmd/go
is installed to GOROOT/bin/GOOS_GOARCH instead of GOROOT/bin.

That means that we need to look for GOROOT in both ../.. and ../../..,
not just the former.

Fixes #62144.
Updates #62119.
Updates #18678.

Change-Id: I283c6a10c46df573ff44da826f870417359226a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/521015
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 9e9556d328c53ed0a4d8b36feee949885d648ba8)
Reviewed-on: https://go-review.googlesource.com/c/go/+/521695
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/testdata/script/goroot_executable.txt
src/cmd/go/testdata/script/goroot_executable_trimpath.txt [new file with mode: 0644]