-
Notifications
You must be signed in to change notification settings - Fork 18k
path/filepath: EvalSymlinks failure #21511
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
(Sorry, I was wrong. I deleted the comment.) |
I think there are many more similar bugs. That just goes to show we should use Windows APIs as much as we can, instead of guessing ourself. Alex |
If I am not confusing, I can reproduce by inserting following code before EvalSymlinks check.
So, the problem is coming from os.Lstat, os.Stat? |
I do not understand your question. This issue is that filepath.EvalSymlinks fails under certain conditions. On Windows only - the program above passes on Linux. I think it should pass on Windows too. Alex |
Please, apply following patch and see what wil happen.
|
I feel that we are failing even in low levels, few guesses. |
I mean, windows is too difficult to me. |
:-} No worries. We will fix it regardless. Alex |
I just had some time to investigate this. And I can see why tests behave differently on Linux and Windows. The problem, I think, is actually os.Getwd on Linux. Linux os.Getwd follows symlink. If I run this:
I get
on Linux and
on Windows. In both we change directory to test/link1 (which is a link), but after the change, we end-up in test on Linux (target of the link), and we remain in test/link1 on Windows. But os.Getwd is documented to work this way: "... If the current directory can be reached via multiple paths (due to symbolic links), Getwd may return any one of them. ...". So this is working as expected. Closing. Sorry for confusion. Alex |
wait, where does |
It is really os.Chdir that follows symlink, but the effect is documented in os.Getwd. Alex |
I changed to call syscall.CreateFile and it didn't work. So I'm convinced. |
What version of Go are you using (
go version
)?go version devel +78984d3954 Wed Aug 16 22:22:19 2017 +0000 windows/amd64
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\users\alex\dev
set GORACE=
set GOROOT=c:\users\alex\dev\go
set GOTOOLDIR=c:\users\alex\dev\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Alex\AppData\Local\Temp\go-build996896503=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
What did you do?
What did you expect to see?
I expect test to PASS
What did you see instead?
The test fails.
Alex
The text was updated successfully, but these errors were encountered: