-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
path/filepath: TestEvalSymlinks tests with "/" prefix fail in Windows #24846
Comments
/cc @alexbrainman |
Change https://golang.org/cl/106975 mentions this issue: |
@JoshVarga I cannot reproduce this. How do I reproduce this? You say you are using go1.10.1. But you error message
does not match the code https://github.com/golang/go/blob/go1.10.1/src/path/filepath/path_test.go#L798 Why? Please provide more details about your environment so I can try and reproduce it here: Thank you. Alex |
I don't think there is a bug in Go just in the test. I believe it is because filepath.Clean reduces the root for a Windows path to C:\ for example but it will not add a volume name onto a path like "/" (that was used in the test). 1.10.1 is my bootstrap compiler to build tip source. I boiled down the code from path_test.go so that it reproduces the issue compiling in 1.10.1 as simple as possible.
This is my full go env
When run the above code on my Windows 10 Pro machine I get:
As requested here is my %TMP%
|
@JoshVarga thank you for providing your environment details. I can reproduce your problem now. The important difference between your setup and mine is that your GOROOT directory lives on the different drive from your TMP directory. I think we need to adjust the test to accommodate for that scenario. I have not decided what to do yet. I will think about this when I have free time. Alex |
What version of Go are you using (
go version
)?go version go1.10.1 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
What did you do?
Built go using "all.bat"
What did you expect to see?
while running tests
ok path/filepath x.xxxs
What did you see instead?
--- FAIL: TestEvalSymlinks (0.04s)
path_test.go:798: EvalSymlinks("C:\Users\varga\AppData\Local\Temp\evalsymlink400713581\test/linkabs") returns "C:\", want "/"
FAIL
FAIL path/filepath 1.552s
I have a code fix for this if this. Essentially just prepending the expected result with the volume name if we are on Windows and the path has a prefix of "/".
Does that sound reasonable?
The text was updated successfully, but these errors were encountered: