-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Restore toleration of missing to-be-deleted files on Windows #1913
Conversation
I run nightly testing of CMake with a nightly build of
|
Thx! You've also added the A suffix to the winapi functions, any reason for that? |
The |
Is this really needed? Couldn't this patch be broken down to just adding |
I was trying to minimize the net change from before #1892 rather than a current net change, since the older code has been deployed and working for years. Try
If you want to switch to |
e6bca0a
to
703cfda
Compare
|
I'm not a fan of the A/W suffix. When we switch to UNICODE this will just create an unnecessary huge diff. The reason to catch an acceptable error directly after I also deliberately used
Seems to be working now. |
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.
I kept the remove(%s)
wording as people might have grep'ed for it.
Can you keep the DeleteFile code path?
…Windows Revise the logic from commit 2d7f7e5 (Delete read-only files on Windows, too, 2020-12-07) to check if `GetFileAttributes` or `DeleteFile` failed due either variant of the file/path-not-found error. Issue: ninja-build#1886
703cfda
to
5392e0e
Compare
Thanks for explaining your reasoning. I added a corresponding comment about |
Thank you for the PR! |
I've just discovered that Windows now supports UTF-8 and we might not need If that really works, using |
Since #1892 we use
DeleteFile
without checking if it failed due to a path missing. Fix theGetFileAttributes
logic to check for multiple variants of "file not found" as we do inStatSingleFile
.Then fall back to the originalAdd the check afterremove()
logic that already checks forENOENT
on failure.DeleteFile
too.Issue: #1886