Closed
Description
go test cmd/go
should succeed even if the user cannot write to GOROOT
, as may be the case if the Go toolchain is provided by a system distribution. (See also #28387.)
Unfortunately, today TestNewReleaseRebuildsStalePackagesInGOPATH
assumes that it can write to GOROOT/src
:
Line 903 in dbd323b
That not only risks a failed write to an unwritable directory, but also makes go test cmd/go
dangerous to run concurrently with any build information, and potentially introduces spurious diffs during testing in development copies of the go
repository.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
bcmills commentedon Dec 14, 2018
One possible resolution might be to copy relevant parts of
GOROOT
into a temporary directory.bcmills commentedon Dec 14, 2018
CC @ianlancetaylor @rsc
ianlancetaylor commentedon Dec 17, 2018
I sent a fix for that test but there are probably others.
gopherbot commentedon Dec 17, 2018
Change https://golang.org/cl/154460 mentions this issue:
cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH