Skip to content

Commit c2d2adb

Browse files
committed
[lldb] Propagate XDG_CACHE_HOME environment variable to tests
This variable is used to reducing the likelihood of hitting module cache issues in CI where different branches can potentially run on the same machine.
1 parent 080ded7 commit c2d2adb

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

lldb/test/API/lit.cfg.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,6 @@ def delete_module_cache(path):
129129
lit_config.warning("unable to inject shared library path on '{}'".format(
130130
platform.system()))
131131

132-
# Propagate LLDB_CAPTURE_REPRODUCER
133-
if 'LLDB_CAPTURE_REPRODUCER' in os.environ:
134-
config.environment['LLDB_CAPTURE_REPRODUCER'] = os.environ[
135-
'LLDB_CAPTURE_REPRODUCER']
136-
137132
# Support running the test suite under the lldb-repro wrapper. This makes it
138133
# possible to capture a test suite run and then rerun all the test from the
139134
# just captured reproducer.
@@ -256,3 +251,12 @@ def delete_module_cache(path):
256251
if 'FREEBSD_LEGACY_PLUGIN' in os.environ:
257252
config.environment['FREEBSD_LEGACY_PLUGIN'] = os.environ[
258253
'FREEBSD_LEGACY_PLUGIN']
254+
255+
# Propagate LLDB_CAPTURE_REPRODUCER
256+
if 'LLDB_CAPTURE_REPRODUCER' in os.environ:
257+
config.environment['LLDB_CAPTURE_REPRODUCER'] = os.environ[
258+
'LLDB_CAPTURE_REPRODUCER']
259+
260+
# Propagate XDG_CACHE_HOME
261+
if 'XDG_CACHE_HOME' in os.environ:
262+
config.environment['XDG_CACHE_HOME'] = os.environ['XDG_CACHE_HOME']

lldb/test/Shell/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'LLDB_CAPTURE_REPRODUCER',
4646
'TEMP',
4747
'TMP',
48+
'XDG_CACHE_HOME',
4849
])
4950

5051
# Support running the test suite under the lldb-repro wrapper. This makes it

lldb/test/Unit/lit.cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'PATH',
2929
'TEMP',
3030
'TMP',
31+
'XDG_CACHE_HOME',
3132
])
3233
llvm_config.with_environment('PATH',
3334
os.path.dirname(sys.executable),

0 commit comments

Comments
 (0)