Closed
Description
What version of Go are you using (go version
)?
Go 1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
Tried installing Go 1.11 from source with
$ cd src
$ ./all.bash
It seems to install, but then TestScript/mod_install_versioned
fails, so the tests do not complete:
go test proxy starting
go test proxy running at GOPROXY=http://127.0.0.1:55555/mod
go proxy: no archive w.1 v1.2.0
go proxy: no archive x.1 v1.0.0
go proxy: no archive z.1 v1.2.0
go proxy: no archive rsc.io v1.5.0
go proxy: no archive example.com/unused v0.0.0
go proxy: no archive example.com/unused v0.0.0
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/foo 14c0d48
go proxy: no archive golang.org/x 14c0d48
go proxy: no archive golang.org 14c0d48
go proxy: no archive sub.1 v1.0.0
go proxy: no archive badsub.1 v1.0.0
go proxy: no archive versioned.1 v1.0.0
go proxy: no archive versioned.1 v1.1.0
go proxy: no archive example.com/split/subpkg v1.0.0
--- FAIL: TestScript (0.00s)
--- FAIL: TestScript/mod_install_versioned (1.63s)
script_test.go:151:
> env GO111MODULE=on
> go list -f '{{.Target}}' rsc.io/fortune
[stdout]
$WORK/gopath/bin/fortune
[stderr]
go: finding rsc.io/fortune v1.0.0
go: downloading rsc.io/fortune v1.0.0
go: finding rsc.io/quote v1.5.2
go: downloading rsc.io/quote v1.5.2
go: finding rsc.io/sampler v1.3.0
go: finding golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
go: downloading rsc.io/sampler v1.3.0
go: downloading golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c
> ! stdout fortune@v1
> stdout 'fortune(\.exe)?$'
> go list -f '{{.Target}}' rsc.io/fortune/v2
[stdout]
$WORK/gopath/bin/fortune
[stderr]
go: finding rsc.io/fortune/v2 v2.0.0
go: downloading rsc.io/fortune/v2 v2.0.0
> ! stdout v2
FAIL: testdata/script/mod_install_versioned.txt:8: unexpected match for `v2` found in stdout: v2
FAIL
FAIL cmd/go 198.341s
I can reproduce this by going into src/cmd/go
and running go test -run TestScript
.
What did you expect to see?
Tests to pass after installing Go 1.11 from source on macOS.
What did you see instead?
TestScript/mod_install_versioned
failure.
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
[-]TestScript/mod_install_versioned consistently failing on macOS High Sierra[/-][+]cmd/go: TestScript/mod_install_versioned consistently failing on macOS High Sierra[/+]ianlancetaylor commentedon Aug 25, 2018
What is the value of
GOTMPDIR
in your environment?ianlancetaylor commentedon Aug 25, 2018
And the
TMPDIR
environment variable?shawnps commentedon Aug 25, 2018
GOTMPDIR=""
ianlancetaylor commentedon Aug 25, 2018
Thanks. The problem is that
TMPDIR
contains the stringv2
, which is causing the regexp to match unexpectedly. That is, the test is verifying that the output does not containv2
, but it does happen to containv2
when it prints$WORK/gopath/bin/fortune
, as$WORK
expands to something like/var/folders/v2/jznq80057xzfwfpl2msl93pm0000gp/T/cmd-go-test-12345
.So this is not an actual test failure, but is rather a bug in the test harness that shows up in your environment.
I'll send a fix.
shawnps commentedon Aug 25, 2018
That makes sense, thank you @ianlancetaylor.
gopherbot commentedon Aug 25, 2018
Change https://golang.org/cl/131398 mentions this issue:
cmd/go: don't let script grep commands match $WORK
shawnps commentedon Aug 25, 2018
@ianlancetaylor
TestScript
now passes with your fix.gopherbot commentedon Aug 25, 2018
Change https://golang.org/cl/131399 mentions this issue:
[release-branch.go1.11] cmd/go: don't let script grep commands match $WORK
[release-branch.go1.11] cmd/go: don't let script grep commands match …