[PATCH] D74548: [debuginfo-tests][Dexter] Downgrade failure to delete working dir to warning not error

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 13 05:21:32 PST 2020


jmorse created this revision.
jmorse added reviewers: Orlando, StephenTozer, TWeaver.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

On Windows, an error running the debugger typically leaves a process hanging around in the working directory. When Dexter exits, it can't then delete the working directory and produces an exception, masking the problem in the debugger. (This can be worked around by specifying --save-temps). Rather than hard-erroring, print a warning when we can't delete the working directory instead.

It'd be much better to improve our error handling, and make the WorkingDirectory class aware that something's wrong when it enters __exit__. However, this is something that's going to mask genuine errors and make everyones lives harder right now, so I think this non-ideal fix is important to get in first.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74548

Files:
  debuginfo-tests/dexter/dex/utils/WorkingDirectory.py


Index: debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
===================================================================
--- debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
+++ debuginfo-tests/dexter/dex/utils/WorkingDirectory.py
@@ -40,7 +40,8 @@
             try:
                 shutil.rmtree(self.path)
                 return
-            except OSError as e:
-                exception = e
+            except OSError:
                 time.sleep(0.1)
-        raise Error(exception)
+
+        self.context.o.yellow('Warning: "{}" left in place [couldn\'t delete]\n'.format(self.path))
+        return


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74548.244394.patch
Type: text/x-patch
Size: 622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/d183a8bf/attachment.bin>


More information about the llvm-commits mailing list