This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Also prune Thin-* files from the ThinLTO cache
ClosedPublic

Authored by hans on Jan 19 2021, 4:51 AM.

Details

Summary

Such files (Thin-%%%%%%.tmp.o) are supposed to be deleted immediately
after they're used (either by renaming or deletion). However, we've seen
instances on Windows where this doesn't happen, probably due to the
filesystem being flaky. This is effectively a resource leak which has
prevented us from using the ThinLTO cache on Windows.

Since those temporary files are in the thinlto cache directory which we
prune periodically anyway, allowing them to be pruned too seems like a
tidy way to solve the problem.

Diff Detail

Event Timeline

hans created this revision.Jan 19 2021, 4:51 AM
hans requested review of this revision.Jan 19 2021, 4:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 4:51 AM
thakis accepted this revision.Jan 19 2021, 5:38 AM
This revision is now accepted and ready to land.Jan 19 2021, 5:38 AM
This revision was landed with ongoing or failed builds.Jan 19 2021, 5:44 AM
This revision was automatically updated to reflect the committed changes.
rnk added a comment.Jan 19 2021, 10:02 AM

Generally speaking, I think LLVM's temp file deletion isn't reliable on Windows. You can see this in your build directory, do find . -iname '*.obj.tmp', and that (at least for me) shows many files left by clang-cl.