[llvm] [lit] Add HOME to "safe" variables to pass through to tests (PR #139367)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 10 02:39:54 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-testing-tools

Author: Michał Górny (mgorny)

<details>
<summary>Changes</summary>

Incldue `HOME` among the variables that are passed through to tests when environment is cleaned. This is necessary for Gentoo build environments, where individual package builds are given temporary home directories that are exposed via `HOME` variable. By stripping the variable, `lit` made these tests attempt to access user's home directory, resulting in permission errors.

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


1 Files Affected:

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


``````````diff
diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py
index b0d8e7149e553..c063851b89526 100644
--- a/llvm/utils/lit/lit/TestingConfig.py
+++ b/llvm/utils/lit/lit/TestingConfig.py
@@ -66,6 +66,7 @@ def fromdefaults(litConfig):
             "DFLTCC",
             "QEMU_LD_PREFIX",
             "QEMU_CPU",
+            "HOME",
         ]
 
         if sys.platform.startswith("aix"):

``````````

</details>


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


More information about the llvm-commits mailing list