-
Notifications
You must be signed in to change notification settings - Fork 18k
path/filepath: go test fails when GOROOT isn't writeable #23881
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
Comments
I wonder if there should be a "read-only builder"? If we're committed to supporting a RO GOROOT maybe? |
For what it's worth, I think it's fine if such an issue comes up occasionally because of no "read-only builder". If it comes up, it can be reported, and then fixed. If no one notices for some time, there's no harm. Running a dedicated builder for the sole purpose of catching this may not be worth the cost of resources (but I'm not in a position to decide, of course). This is assuming that all such issues are trivial to resolve by writing to a temporary directory rather than GOROOT. |
We should avoid writing temp files to GOROOT, since it might be readonly. Fixes golang#23881 Change-Id: Iaa38ec404b303f0cf27fdfb7daf1ddd60fd5d1c9
We should avoid writing temp files to GOROOT, since it might be readonly. Fixes golang#23881 Change-Id: Iaa38ec404b303f0cf27fdfb7daf1ddd60fd5d1c9
Change https://golang.org/cl/98517 mentions this issue: |
We should avoid writing temp files to GOROOT, since it might be readonly. Fixes golang#23881 Change-Id: Iaa38ec404b303f0cf27fdfb7daf1ddd60fd5d1c9
We should avoid writing temp files to GOROOT, since it might be readonly. Fixes golang#23881 Change-Id: I500ca0e0944b6053fd8fd2879ff88f5636424dab
We should avoid writing temp files to GOROOT, since it might be readonly. Fixes golang#23881 Change-Id: I500ca0e0944b6053fd8fd2879ff88f5636424dab
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, with Go 1.10 (final).
What operating system and processor architecture are you using (
go env
)?What did you do?
go1.10.darwin-amd64.pkg
installer on a Mac.go test path/filepath
.What did you expect to see?
What did you see instead?
However, adding
sudo
, it works okay:This happens because
TestWalk
callsmakeTree
, which tries to create new files inGOROOT/src/path/filepath
directory. Since the GOROOT directory isn't writeable by normal user, creating the test tree fails. Then, trying to walk the tree results in a nil pointer dereference panic.I'm not sure why
TestWalk
tries to write in GOROOT at all. Shouldn't it create a temporary directory and use that?The text was updated successfully, but these errors were encountered: