This is an archive of the discontinued LLVM Phabricator instance.

[Support] [Windows] Don't cancel delete if we failed to set delete
ClosedPublic

Authored by sbaig1 on Jan 25 2022, 8:18 PM.

Details

Summary

Following up on commit 177176f75c6fa3f624d6d964b9d340ce39511565, if we
failed to setDeleteDisposition(true) during TempFile creation, then
don't try to setDeleteDisposition(false) during TempFile::keep, since it
will likely fail as well.

Instead of letting TempFile::keep just fail, we should let it go ahead
and try renaming the file.

This fixes an issue we are seeing when running clang-cl.exe through the
Incredibuild distributed build system. We're seeing that renaming
temporary object files would fail here:
https://github.com/llvm/llvm-project/blob/5c1f7b296ac0dddeca02891976e6ab5cfc006719/clang/lib/Frontend/CompilerInstance.cpp#L789

Diff Detail

Event Timeline

sbaig1 created this revision.Jan 25 2022, 8:18 PM
sbaig1 requested review of this revision.Jan 25 2022, 8:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2022, 8:18 PM
mstorsjo accepted this revision.Jan 27 2022, 3:25 AM

LGTM, thanks.

If you don't have commit access and need someone to push the change for you, please provide your preferred git author line in the form Real Name <email@address>.

This revision is now accepted and ready to land.Jan 27 2022, 3:25 AM

Thanks Martin! I don't have commit access so it would be great if someone can push this change for me. My git author line is Shezan Baig <sbaig1@bloomberg.net>

This revision was landed with ongoing or failed builds.Jan 27 2022, 3:58 AM
This revision was automatically updated to reflect the committed changes.