[Lldb-commits] [PATCH] D139643: [lldb][Test] TestRerunAndExpr.py: explicitly delete a.out before rebuilding it

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 8 09:14:06 PST 2022


Michael137 created this revision.
Michael137 added a reviewer: aprantl.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

**Summary**

Older versions of `make` would occasionally fail to realize
that a pre-requisite for the `a.out` target has changed. This
resulted in roughly 1 out of 10 test runs to fail. Instead of
relying on `make` to resolve this dependency simply remove the
file before rebuilding; this will give make no option but to
remake `a.out`.

**Testing**

- Confirmed that the test passes on the host for 100 runs where without the patch it would fail after ~10

**Details**

Adding `-d` to lldbtest's `make` invocation and running the
test without this patch sometimes yielded:

  Removing child 0x600000308ff0 PID 19915 from chain.
      Successfully remade target file `rebuild.o'.
     Finished prerequisites of target file `a.out'.
     Prerequisite `rebuild.o' is newer than target `a.out'.
    No need to remake target `a.out'.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139643

Files:
  lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py


Index: lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py
===================================================================
--- lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py
+++ lldb/test/API/functionalities/rerun_and_expr/TestRerunAndExpr.py
@@ -41,6 +41,8 @@
                 ValueCheck(name='m_val', value='42')
             ])
 
+        # Force make to rebuild the executable by deleting it.
+        remove_file(exe)
         self.build(dictionary={'CXX_SOURCES':'rebuild.cpp', 'EXE':'a.out'})
 
         # Rerun program within the same target


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139643.481323.patch
Type: text/x-patch
Size: 585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221208/37cae3b0/attachment.bin>


More information about the lldb-commits mailing list