[PATCH] D79802: Fixed a problem removing temp files

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 13:28:15 PDT 2020


PeteSteinfeld created this revision.
PeteSteinfeld added a reviewer: yln.
Herald added subscribers: llvm-commits, delcypher.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.

Before making this change, whenever I ran "check-flang", I'd get an
error message like:

llvm-lit: /mnt/c/GitHub/f18/c751/flang/build/bin/../../../llvm/utils/lit/lit/main.py:252: warning: Failed to delete temp directory '/tmp/lit_tmp_gOKUIh'

With this change, there's no such message in the output, and the temp
directory is successfully removed.

Note that my working environment is on Windows 10 running Windows
Subsystem for Linux using the Ubuntu app.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79802

Files:
  llvm/utils/lit/lit/main.py


Index: llvm/utils/lit/lit/main.py
===================================================================
--- llvm/utils/lit/lit/main.py
+++ llvm/utils/lit/lit/main.py
@@ -248,8 +248,10 @@
                 import shutil
                 shutil.rmtree(tmp_dir)
             except:
-                # FIXME: Re-try after timeout on Windows.
-                lit_config.warning("Failed to delete temp directory '%s'" % tmp_dir)
+                try:
+                    os.rmdir(tmp_dir)
+                except:
+                    lit_config.warning("Failed to delete temp directory '%s'" % tmp_dir)
 
 
 def print_histogram(tests):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79802.263505.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200512/37044d28/attachment.bin>


More information about the llvm-commits mailing list