Skip to content

Commit

Permalink
cmd/go: fix TestScript/mod_gobuild_import on Plan 9
Browse files Browse the repository at this point in the history
CL 125296 added TestScript/mod_gobuild_import. This
test is failing on Plan 9, because go/build invokes
the go tool which cannot be found in the path.

The "PATH" environment variable has been updated to
contain the path to the go tool on Unix and Windows,
but on Plan 9, the analogous environment variable is
called "path".

This change fixes the script engine by setting
the "path" environment variable on Plan 9.

Fixes golang#26669.

Change-Id: If1be50e14baceccee591f4f76b7e698f5e12a2d4
Reviewed-on: https://go-review.googlesource.com/126608
Run-TryBot: David du Colombier <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
0intro committed Jul 29, 2018
1 parent 5ad0a52 commit 154394f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmd/go/script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func (ts *testScript) setup() {
":=" + string(os.PathListSeparator),
}

if runtime.GOOS == "plan9" {
ts.env = append(ts.env, "path="+testBin+string(filepath.ListSeparator)+os.Getenv("path"))
}

if runtime.GOOS == "windows" {
ts.env = append(ts.env, "exe=.exe")
} else {
Expand Down

0 comments on commit 154394f

Please sign in to comment.