Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: TestNewReleaseRebuildsStalePackagesInGOPATH modifies code in GOROOT #29263

Closed
bcmills opened this issue Dec 14, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@bcmills
Copy link
Member

commented Dec 14, 2018

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:

sys := runtime.GOROOT() + "/src/runtime/internal/sys/sys.go"

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.

@bcmills bcmills added the Testing label Dec 14, 2018

@bcmills bcmills added this to the Go1.13 milestone Dec 14, 2018

@gopherbot gopherbot removed the NeedsFix label Dec 14, 2018

@bcmills

This comment has been minimized.

Copy link
Member Author

commented Dec 14, 2018

One possible resolution might be to copy relevant parts of GOROOT into a temporary directory.

@bcmills

This comment has been minimized.

Copy link
Member Author

commented Dec 14, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2018

I sent a fix for that test but there are probably others.

@gopherbot

This comment has been minimized.

Copy link

commented Dec 17, 2018

Change https://golang.org/cl/154460 mentions this issue: cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH

@gopherbot gopherbot closed this in c077c74 Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.