aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2018-07-19 10:41:54 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2018-07-19 19:03:56 +0000
commit0ba03b8f42dc09212dfa28baa374577168a2bce7 (patch)
tree5061a56064fe362a0f9156d7a2d953b43a375203
parentfec97c0aa76eb19bd58ca33001063b726ab9ce27 (diff)
downloadgo-0ba03b8f42dc09212dfa28baa374577168a2bce7.tar.gz
go-0ba03b8f42dc09212dfa28baa374577168a2bce7.zip
cmd/go: fix TestScript on Plan 9
CL 123577 added TestScript. The install_rebuild_gopath test was failing on Plan 9 because it defines a GOPATH using the ':' separator, while Plan 9 expects the '\000' separator in environment variables. This change fixes the script engine by defining a new ":" environment variable set to OS-specific path list separator. The install_rebuild_gopath test has been updated to use "${:}" instead of ":". Fixes #26421. Change-Id: I58a97f882cdb48cc0836398b0d98a80ea58041ba Reviewed-on: https://go-review.googlesource.com/124435 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/cmd/go/script_test.go1
-rw-r--r--src/cmd/go/testdata/script/README2
-rw-r--r--src/cmd/go/testdata/script/install_rebuild_gopath.txt3
3 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index 33bd6440e7..d8bcd07962 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -95,6 +95,7 @@ func (ts *testScript) setup() {
"GOROOT=" + testGOROOT,
tempEnvName() + "=" + filepath.Join(ts.workdir, "tmp"),
"devnull=" + os.DevNull,
+ ":=" + string(os.PathListSeparator),
}
if runtime.GOOS == "windows" {
diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README
index 0418bc9f13..a80233b8c3 100644
--- a/src/cmd/go/testdata/script/README
+++ b/src/cmd/go/testdata/script/README
@@ -149,7 +149,7 @@ and only shows the # comments for earlier phases. For example, here is a
multi-phase script with a bug in it:
# GOPATH with p1 in d2, p2 in d2
- env GOPATH=$WORK/d1:$WORK/d2
+ env GOPATH=$WORK/d1${:}$WORK/d2
# build & install p1
env
diff --git a/src/cmd/go/testdata/script/install_rebuild_gopath.txt b/src/cmd/go/testdata/script/install_rebuild_gopath.txt
index 568249bf70..d42b07004b 100644
--- a/src/cmd/go/testdata/script/install_rebuild_gopath.txt
+++ b/src/cmd/go/testdata/script/install_rebuild_gopath.txt
@@ -1,6 +1,5 @@
# GOPATH with p1 in d1, p2 in d2
-[!windows] env GOPATH=$WORK/d1:$WORK/d2
-[windows] env GOPATH=$WORK/d1;$WORK/d2
+env GOPATH=$WORK/d1${:}$WORK/d2
# build & install p1
go install -i p1