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
Closed
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills 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 An issue that has been verified to require only test changes, not just a test failure. label Dec 14, 2018
@bcmills bcmills added this to the Go1.13 milestone Dec 14, 2018
@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 14, 2018
@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Dec 14, 2018
@bcmills
Copy link
Contributor Author

bcmills commented Dec 14, 2018

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

@bcmills
Copy link
Contributor Author

bcmills commented Dec 14, 2018

CC @ianlancetaylor @rsc

@ianlancetaylor
Copy link
Contributor

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

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants