Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

sdkrystian
Copy link
Member

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 llvmbot added the clang Clang issues not falling into any other category label Apr 29, 2024
@sdkrystian sdkrystian requested a review from AaronBallman April 29, 2024 14:33
@llvmbot
Copy link
Member

llvmbot commented Apr 29, 2024

@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 --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
Copy link
Member Author

@cor3ntin Updated

@sdkrystian sdkrystian requested a review from cor3ntin April 29, 2024 16:23
Copy link
Contributor

@cor3ntin cor3ntin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants