forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We want to use the latest go when developing our own release/testing support tools and scripts. So, update go.mod to do so. However, we need to be careful when using the `installtools` script. The purpose of `installtools` is to install tools needed by integration tests. It selected the latest version of each tool compatible with the default go version in the system. For example, in the CI is setup with go1.22, we want to install tools that officially claim they support go1.22. `installtools` detects the go version using the `go` command. As we change our go.mod to use go1.23.1 as the go directive, the `go` command running under our project's repo directory (with GOTOOLCHAIN=auto) will always be go1.23.1 or newer. That makes go1.22 CI meaningless. So, pass `GOTOOLCHAIN=local` when `installtools` computes the go version using `go list`. Previously we used `go run` to build/invoke this tool. But it turned out `go run`/`go generate` modify (or will modify) `GOROOT` and/or `PATH` when toolchain switch occurs, which will prevent `installtools` from detecting the system default toolchain version even with `GOTOOLCHAIN=local`, or cause the build fail due to mismatching GOROOT and go toolchain picked up from PATH. Therefore, in this CL, we build the binary (it's ok to build the binary with go1.23.1+), and then run the installed binary ourselves so the execution of the binary doesn't get inherit the modified GOROOT/PATH. For golang#3411 Change-Id: I3e116cf48fb431196359ec42049e70c0b75814ef
- Loading branch information
Showing
5 changed files
with
18 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters