[llvm] [lit] Allow passthrough of some QEMU_* environment variables to lit (PR #111373)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 05:51:56 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-testing-tools

Author: Alex Bradbury (asb)

<details>
<summary>Changes</summary>

This is an alternate implementation of a patch proposed by @<!-- -->preames in <https://reviews.llvm.org/D128840>. As noted there, when running non-native binaries with binfmt_misc and qemu-user you typically need to set some environment variables (at least, QEMU_LD_PREFIX), but lit strips them by default. This patch adds what I think are the two main ones to the list of those that aren't stripped. It does so in a place that applies to all lit test suites (rather than just LLVM's), and as can be seen from the other env vars in `pass_vars` I think there's already plenty of precedent for passing through environment variables known to be potentially useful to LLVM developers.

---
Full diff: https://github.com/llvm/llvm-project/pull/111373.diff


1 Files Affected:

- (modified) llvm/utils/lit/lit/TestingConfig.py (+2) 


``````````diff
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py
index f81b07baeeaed0..b0d8e7149e553c 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -64,6 +64,8 @@ def fromdefaults(litConfig):
             "SOURCE_DATE_EPOCH",
             "GTEST_FILTER",
             "DFLTCC",
+            "QEMU_LD_PREFIX",
+            "QEMU_CPU",
         ]
 
         if sys.platform.startswith("aix"):

``````````

</details>


https://github.com/llvm/llvm-project/pull/111373


More information about the llvm-commits mailing list