[libcxx-commits] [PATCH] D110887: [libcxx][test] Use python specified by build rather than system default python

Leonard Chan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 30 15:14:59 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: ldionne, DavidSpickett, phosek.
leonardchan added a project: libc++.
Herald added a subscriber: arichardson.
leonardchan requested review of this revision.
Herald added a reviewer: libc++.

As of e9564c3698edffc64439a8f957c7c28b19214613 <https://reviews.llvm.org/rGe9564c3698edffc64439a8f957c7c28b19214613>, `libcxx/gdb/gdb_pretty_printer_test.sh.cpp` fails locally for me because the `REQUIRES` check for `host-has-gdb-with-python` uses `python`, which for me expands to python 2.7.18. This failure does not seem to be caught on any upstream builders, potentially because they don't have gdb, python, or a version of python that makes the test `UNSUPPORTED` (like python3).

This updates the check to use the python specified by the build (which should be the python that runs this code), rather than just `python`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110887

Files:
  libcxx/utils/libcxx/test/features.py


Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -179,7 +179,7 @@
 
   try:
     stdout = subprocess.check_output(
-              [gdb_path, "-ex", "python " + test_src, "--batch"],
+              [gdb_path, "-ex", sys.executable + " " + test_src, "--batch"],
               stderr=subprocess.DEVNULL, universal_newlines=True)
   except subprocess.CalledProcessError:
     # We can't set breakpoint commands


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110887.376380.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210930/37bb7757/attachment-0001.bin>


More information about the libcxx-commits mailing list