-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: TestIssue29372 fails on windows-arm builder #29746
Comments
I'm looking into |
@alexbrainman Do you know why After fixing |
It is worth noting that none of this is ARM-specific. It is showing up on the ARM builder because %tmp% is a path that contains a volume mount point. |
Nice debugging. So %TMP% directory path has symlink in it. And it is symlink into
From what I remember, we had walkSymlinks first. And that worked for awhile. But then we discovered symlinks that points to unusual places, like symlink into We could have adjusted os.Readlink to return these paths as is. But I don't think you could use So we came up with current approach to use CreateFile+GetFinalPathNameByHandle to implement path/filepath.EvalSymlinks. And that worked, but it works differently in some corner cases. For example, see path/filepath.TestIssue29372. I suspect many others. So, for backward compatibility, we decided to use walkSymlinks first, and, if that fails, use evalSymlinksUsingGetFinalPathNameByHandle. That covers most current scenarios.
I don't think we could return
Yes, I agree. This is not windows-arm specific. Let me think about this for a couple of days. If I won't come up with anything, I will skip the test for go1.13. Alex |
Are you sure GetFinalPathNameByHandle will return nt namespace paths? It looks like there is an option to request DOS-style paths ( |
Change https://golang.org/cl/159578 mentions this issue: |
I was not talking not about GetFinalPathNameByHandle when I spoke about nt namespace paths. I was talking about os.Readlink implementation. If you look at syscal.Readlink, you will see that it uses Anyway I will make TestIssue29372 pass for the moment (see https://golang.org/cl/159578). We would have to deal with this later. I don't see any quick solutions here. Alex |
@jordanrh1 I forgotten to ask, if you could verify that https://golang.org/cl/159578 makes TestIssue29372 pass. Thank you. Alex |
TestIssue29372 is broken on windows when temporary directory has symlink in its path. Adjust the test to use filepath.EvalSymlinks of temporary directory, instead of temporary directory on windows. This change is not a proper fix, but at least it makes TestIssue29372 pass on windows-arm. See issue for details. Updates #29746 Change-Id: I2af8ebb89da7cb9daf027a5e49e32ee22dbd0e3d Reviewed-on: https://go-review.googlesource.com/c/159578 Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Change https://golang.org/cl/164202 mentions this issue: |
@jordanrh1 can you, please, test https://golang.org/cl/164202 on your windows-arm computer, before we submit it. Thank you. Alex |
@jhowardmsft FYI, please, see https://golang.org/cl/164202 - hopefully it will be part of go1.13. Alex |
@alexbrainman Some comments on the CL (I don't have an account on googlesource.com)
|
A follow-up comment is when a program calls |
@jhowardmsft I was also initially confused by @alexbrainman TestIssue2937 is now passing. Here is the raw output:
|
I will take review comments from anywhere.
What @jordanrh1 said. If you run
Done.
Thanks. I am actually in Australia, but GB will do.
I am pretty sure GetFinalPathNameByHandle will fail. I am pretty sure I tried calling GetFinalPathNameByHandle on Docker mounted volumes from inside container. And it fails. And it is fine with me for now.
If symlink target path is
Thank you, Jordan, for checking. Alex |
windows-arm TMP directory live inside such link (see #29746 (comment) for details), so symlinks like that will be common at least on windows-arm. This CL builds on current syscall.Readlink implementation. Main difference between the two is how new code handles symlink targets, like \??\Volume{ABCD}\. New implementation uses Windows CreateFile API with FILE_FLAG_OPEN_REPARSE_POINT flag to get \??\Volume{ABCD}\ file handle. And then it uses Windows GetFinalPathNameByHandle with VOLUME_NAME_DOS flag to convert that handle into standard Windows path. FILE_FLAG_OPEN_REPARSE_POINT flag ensures that symlink is not followed when CreateFile opens the file. Fixes #30463 Change-Id: I33b18227ce36144caed694169ef2e429fd995fb4 Reviewed-on: https://go-review.googlesource.com/c/164201 Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Since 44cf595 windows-arm builder fails with
https://build.golang.org/log/c00262fb40118e6917815b61ce7e1643b702bdc3
I don't see how TestIssue29372 can fail this way. @jordanrh1 please help to debug this.
We can skip the test on windows-arm, but I would like to understand what is wrong here first.
Thank you.
Alex
The text was updated successfully, but these errors were encountered: