-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Update Sys.isexecutable()
to use new jl_fs_access()
API call
#35625
Conversation
9cf9f46
to
21544e1
Compare
fixes #33212? |
Yes. Finally. :) To test, you can use this function. On current Julia, reports all filesystems on Windows to be permissions-blind, with this change, most filesystems on windows are not reported as permissions-blind. (FAT32 may still be, I haven't tested that) |
Alright the windows tests are failing because there's an assumption in the test suite that Is it worthwhile for me to go and fix |
Turns out the error is because we aren't setting the (independent from ACLs) readonly bit anymore in this PR. I've got a new PR to libuv here that fixes this: JuliaLang/libuv#8 |
91e5b7a
to
a356837
Compare
416dd64
to
4ec36c9
Compare
…ls on windows These updates use the Windows ACL APIs to ask whether a file is truly executable or not, allowing us to properly `chmod()` and `access()` to set/get the executable bit reliably on windows.
4ec36c9
to
7edda0d
Compare
`jl_fs_access()` makes use of the `uv_fs_access()` call from LibUV, which is newly-able to interrogate Win32 ACLs, determining whether a file is truly executable or not on Windows. Also update `chmod()` to note that on windows, recursive is effectively always true.
7edda0d
to
f5a6779
Compare
Thanks to Jameson's proddings, I think I've actually found a combination of flags that gives us the expected behavior of |
Unbekownst to me, Windows defaults to files being executable, so we were incorrectly extracting normal files as executables. We didn't detect this because until JuliaLang/julia#35625 we were blind to the executable bit on Windows. With that change, however, we can now tell that we are incorrectly leaving normal files executable. JuliaLang/Pkg.jl#2253 fixes Pkg's GitTools.tree_hash and in the process breaks our tests since they now correctly detect that we are extracting non-executable files incorrectly on Windows. This PR fixes that, making tests pass again with that fix.
Unbekownst to me, Windows defaults to files being executable, so we were incorrectly extracting normal files as executables. We didn't detect this because until JuliaLang/julia#35625 we were blind to the executable bit on Windows. With that change, however, we can now tell that we are incorrectly leaving normal files executable. JuliaLang/Pkg.jl#2253 fixes Pkg's GitTools.tree_hash and in the process breaks our tests since they now correctly detect that we are extracting non-executable files incorrectly on Windows. This PR fixes that, making tests pass again with that fix.
Unbekownst to me, Windows defaults to files being executable, so we were incorrectly extracting normal files as executables. We didn't detect this because until JuliaLang/julia#35625 we were blind to the executable bit on Windows. With that change, however, we can now tell that we are incorrectly leaving normal files executable. JuliaLang/Pkg.jl#2253 fixes Pkg's GitTools.tree_hash and in the process breaks our tests since they now correctly detect that we are extracting non-executable files incorrectly on Windows. This PR fixes that, making tests pass again with that fix. * Use `Sys.isexecutable()` on Windows to determine file mode * Manually set permissions while copying symlinks * copy mode recursively for copied symlinks on Windows * use a copy of `Pkg.GitTools.tree_hash` with `isexecutable` fix Co-authored-by: Elliot Saba <[email protected]>
This pull request bumps the
libuv
version to include JuliaLang/libuv#6, which un-breaksSys.isexecutable()
on Windows.