Skip to content

Commit

Permalink
cmd/go: fix TestScript on Plan 9
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
0intro authored and bradfitz committed Jul 19, 2018
1 parent fec97c0 commit 0ba03b8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/cmd/go/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/testdata/script/README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/go/testdata/script/install_rebuild_gopath.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0ba03b8

Please sign in to comment.