[clang] [Clang] Propagate 'SystemDrive' environment variable for unit tests (PR #90478)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 07:32:49 PDT 2024


https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/90478

On windows, running unit tests by directly invoking `llvm-lit.py` (e.g. `python3 llvm-lit.py clang/test/Unit`) will (at least on my system) create a folder named `%SystemDrive%` in the working directory. This seems to happen because `lit.cfg.py` in `clang/test/Unit` does not propagate the `SystemDrive` environment variable.


>From b52984893c1f83963f90c4784e17f4cf2243e046 Mon Sep 17 00:00:00 2001
From: Krystian Stasiowski <sdkrystian at gmail.com>
Date: Mon, 29 Apr 2024 10:01:14 -0400
Subject: [PATCH] [Clang] Propagate 'SystemDrive' environment variable for unit
 tests

---
 clang/test/Unit/lit.cfg.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/test/Unit/lit.cfg.py b/clang/test/Unit/lit.cfg.py
index 475069e630d74e..265e90968febb0 100644
--- a/clang/test/Unit/lit.cfg.py
+++ b/clang/test/Unit/lit.cfg.py
@@ -32,6 +32,8 @@
 
 if "HOME" in os.environ:
     config.environment["HOME"] = os.environ["HOME"]
+if "SystemDrive" in os.environ:
+    config.environment["SystemDrive"] = os.environ["SystemDrive"]
 
 # Propagate sanitizer options.
 for var in [



More information about the cfe-commits mailing list