Skip to content

Commit 3037aa7

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. (cherry picked from commit c2d2adb)
1 parent ad4b091 commit 3037aa7

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.
@@ -259,3 +254,12 @@ def delete_module_cache(path):
259254
if 'FREEBSD_LEGACY_PLUGIN' in os.environ:
260255
config.environment['FREEBSD_LEGACY_PLUGIN'] = os.environ[
261256
'FREEBSD_LEGACY_PLUGIN']
257+
258+
# Propagate LLDB_CAPTURE_REPRODUCER
259+
if 'LLDB_CAPTURE_REPRODUCER' in os.environ:
260+
config.environment['LLDB_CAPTURE_REPRODUCER'] = os.environ[
261+
'LLDB_CAPTURE_REPRODUCER']
262+
263+
# Propagate XDG_CACHE_HOME
264+
if 'XDG_CACHE_HOME' in os.environ:
265+
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)