llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
25.95k stars 10.58k forks source link

[Clang] Propagate 'SystemDrive' environment variable for unit tests #90478

Closed sdkrystian closed 2 weeks ago

sdkrystian commented 2 weeks ago

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.

llvmbot commented 2 weeks ago

@llvm/pr-subscribers-clang

Author: Krystian Stasiowski (sdkrystian)

Changes 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. --- Full diff: https://github.com/llvm/llvm-project/pull/90478.diff 1 Files Affected: - (modified) clang/test/Unit/lit.cfg.py (+2) ``````````diff 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 [ ``````````
sdkrystian commented 2 weeks ago

@cor3ntin Updated