mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-30 16:20:37 +00:00
test.bash: unset GOROOT to fix Travis-CI
When Travis-CI runs the test.bash, it unnecessarily pollutes the environment with a GOROOT environment variable, which confuses each of the custom invocations of different Go toolchains. Rather than setting the GOROOT prior to each invocation of the Go toolchain, just clear the variable once, and let each toolchain figure out the root for themselves (which all recent versions of Go know how to do so correctly). Change-Id: I45ae9f9f98f5573ff42502b7244c90bf1569f66e Reviewed-on: https://go-review.googlesource.com/128363 Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
parent
ed2fbe0328
commit
d1e65e6634
@ -37,6 +37,10 @@ for GO_VERSION in ${GO_VERSIONS[@]}; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Travis-CI sets GOROOT, which confuses later invocations of the Go toolchains.
|
||||
# Explicitly clear GOROOT, so each toolchain uses their default GOROOT.
|
||||
unset GOROOT
|
||||
|
||||
# Download dependencies using modules.
|
||||
# For pre-module support, dump the dependencies in a vendor directory.
|
||||
# TODO: use GOFLAGS="-mod=readonly" when https://golang.org/issue/26850 is fixed.
|
||||
@ -54,7 +58,6 @@ export GOPATH=$TEST_DIR/gopath
|
||||
# Run tests across every supported version of Go.
|
||||
FAIL=0
|
||||
for GO_VERSION in ${GO_VERSIONS[@]}; do
|
||||
export GOROOT=$TEST_DIR/go$GO_VERSION
|
||||
GO_BIN=go$GO_VERSION/bin/go
|
||||
function go_build() {
|
||||
echo "$GO_BIN build $@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user