Closed
Description
+ /usr/local/google/home/bcmills/go-review/bin/go test cmd/go -run=TestScript/build_trimpath
go test proxy running at GOPROXY=http://127.0.0.1:39195/mod
--- FAIL: TestScript (0.01s)
--- FAIL: TestScript/build_trimpath (4.42s)
script_test.go:213:
# If GOROOT_FINAL is set, 'go build -trimpath' bakes that into the resulting
# binary instead of GOROOT. Explicitly unset it here. (0.000s)
# Set up two identical directories that can be used as GOPATH. (0.001s)
# A binary built without -trimpath should contain the module root dir
# and GOROOT for debugging and stack traces. (0.217s)
# A binary built with -trimpath should not contain the current workspace
# or GOROOT. (2.437s)
# A binary from an external module built with -trimpath should not contain
# the current workspace or GOROOT. (0.356s)
# Two binaries built from identical packages in different directories
# should be identical. (0.182s)
# Same sequence of tests but with overlays.
# A binary built without -trimpath should contain the module root dir
# and GOROOT for debugging and stack traces. (0.212s)
# A binary built with -trimpath should not contain the current workspace
# or GOROOT. (0.202s)
# Two binaries built from identical packages in different directories
# should be identical. (0.158s)
# Same sequence of tests but in GOPATH mode.
# A binary built without -trimpath should contain GOPATH and GOROOT. (0.195s)
# A binary built with -trimpath should not contain GOPATH or GOROOT. (0.202s)
# Two binaries built from identical packages in different GOPATH roots
# should be identical. (0.173s)
# Same sequence of tests but with gccgo.
# gccgo does not support builds in module mode. (0.000s)
# A binary built with gccgo without -trimpath should contain the current
# GOPATH and GOROOT. (0.065s)
> go build -compiler=gccgo -o paths-dbg.exe paths
[stderr]
# paths
a/src/paths/paths.go:15:18: error: reference to undefined identifier 'os.ReadFile'
15 | data, err := os.ReadFile(exe)
| ^
[exit status 2]
FAIL: testdata/script/build_trimpath.txt:101: unexpected command failure
FAIL
FAIL cmd/go 6.606s
~$ gccgo --version
gccgo (Debian 10.2.1-3) 10.2.1 20201224
I suspect that this was broken by CL 266365 and masked by #35786 (CC @golang/release).
@ianlancetaylor, do you think it's worth backporting a fix to the 1.16 release branch?
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
bcmills commentedon Jan 28, 2021
Confirmed the root cause with
git bisect
. Fix forthcoming.gopherbot commentedon Jan 28, 2021
Change https://golang.org/cl/287613 mentions this issue:
cmd/go: revert TestScript/build_trimpath to use ioutil.ReadFile
ianlancetaylor commentedon Jan 28, 2021
This commit will automatically wind up on the 1.16 branch anyhow.
It's useful for tests to pass with gccgo but I think it's not essential. In general I wouldn't worry about backports. Thanks.
1 remaining item