-
Notifications
You must be signed in to change notification settings - Fork 266
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
windows: fixes unlinking symlink to dir, rmdir on opened empty dir. #1172
Conversation
Signed-off-by: Takeshi Yoneda <[email protected]>
not found a fix yet. |
require.EqualErrno(t, syscall.EISDIR, err) | ||
|
||
require.NoError(t, os.Remove(realPath)) | ||
}) | ||
|
||
t.Run("target: symlink to dir", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is the new one and only windows failing
interesting as I expected this only fails with 1.20. |
looks like this has existed for a while but somehow hasn't been caught until Zig test has started failing with 1.20 upgrade |
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
ok original issue has been fixed, but another comes up:
|
@mathetake the other one looks like they are skipping on windows, which I guess is annoying because we can't do that without excluding "makePath in a directory that no longer exists" from all operating systems (due to the filter being a compile option). one way could be to exclude it from zig, but re-add the test in our repo so that it runs when != windows. wdyt? |
|
minimize the case test "minimized" {
var tmp = tmpDir(.{});
tmp.parent_dir.deleteTree(&tmp.sub_path) catch @panic("aaaaaaaa");
} |
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
found the repro which only fails on windows 1e35027 |
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@@ -140,6 +140,10 @@ func open(path string, mode int, perm uint32) (fd syscall.Handle, err error) { | |||
} | |||
} | |||
} | |||
if createmode == syscall.OPEN_EXISTING && access == syscall.GENERIC_READ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lifted from the change made in Go 1.20 https://github.com/golang/go/blob/go1.20/src/syscall/syscall_windows.go#L308-L379 and I guess that's why we haven't encountered it before.
LOL only windows 1.18 is failing LOL |
Signed-off-by: Takeshi Yoneda <[email protected]>
🤞 |
42e4c13
to
0ca0dbd
Compare
Signed-off-by: Takeshi Yoneda <[email protected]>
all went green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
h, e := syscall.CreateFile(pathp, access, sharemode, sa, createmode, attrs, 0) | ||
return h, e | ||
} | ||
|
||
var isGo120 = strings.Contains(runtime.Version(), "go1.20") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break in 1.21 but I can sort it after merge
No description provided.