-
Notifications
You must be signed in to change notification settings - Fork 340
[🍒 stable/20230725] [Support] Handle delete_pending case for Windows fs::status (#90655) #8850
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
[🍒 stable/20230725] [Support] Handle delete_pending case for Windows fs::status (#90655) #8850
Conversation
If a delete is pending on the file queried for status, a misleading `permission_denied` error code will be returned (this is the correct mapping of the error set by GetFileAttributesW). By querying the underlying NTSTATUS code via ntdll's RtlGetLastNtStatus, this case can be disambiguated. If this underlying error code indicates a pending delete, fs::status will return a new `pending_delete` error code to be handled by callers Fixes llvm#89137 (cherry picked from commit cb7690a)
@swift-ci please test |
Checkout:
Okay, so you're picking up the new top-of-main swift-driver. This suggests that the build-script invocation isn't using one of the new presets, so it's either not checking out a new Swift checkout, or using a raw build-script invocation instead of going through a preset. The clang-linker would then default to use bfd....
And it looks like the second one is our issue... now to figure out how to change that build-script invocation to set the clang-linker-driver's default linker to not-bfd. 🤔 |
Thanks for looking at that failure Evan!
Is this anything I could help out with? I'm afraid I don't have much context into how this CI is pieced together. (Is this stuff public-facing or internal to Apple?) |
I think this one is internal, unfortunately. There isn't a preset for this job so it will take modifying the CI job directly to fix it. |
Thanks for for fixing that Evan! Much appreciated. It looks like the CI jobs here pull from a branch in |
@swift-ci please test Linux platform |
Yeah, just landed the changes on the CI itself so it should pick up that preset now. |
Explanation: Adds a new
delete_pending
error code which is returned fromfs::status
on Windows when the destination path is markedSTATUS_DELETE_PENDING
. Previously, this would return a misleadingpermission_denied
error code.Scope: This change is needed for #8848, which fixes a common compiler crash on Windows when indexing-while-building.
Issue: llvm#89137
Risk: Very low risk, this change introduces a new error code that can only be generated under specific conditions on Windows.
Testing: Tested through LLVM CI and locally.
Reviewer: @compnerd @bnbarham
If a delete is pending on the file queried for status, a misleading
permission_denied
error code will be returned (this is the correct mapping of the error set by GetFileAttributesW). By querying the underlying NTSTATUS code via ntdll's RtlGetLastNtStatus, this case can be disambiguated. If this underlying error code indicates a pending delete, fs::status will return a newpending_delete
error code to be handled by callersFixes llvm#89137
(cherry picked from commit cb7690a)