about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/llvm/git/llvm/lit-shell-script-runner-set-dyld-library-path.patch
blob: 82b7b21c55fb143b9c9699201f0b5007c486a2f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/utils/lit/lit/TestRunner.py b/utils/lit/lit/TestRunner.py
index 0242e0b75af3..d732011306f7 100644
--- a/utils/lit/lit/TestRunner.py
+++ b/utils/lit/lit/TestRunner.py
@@ -1029,6 +1029,12 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
             f.write('@echo off\n')
         f.write('\n@if %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
     else:
+        # This env var is *purged* when invoking subprocesses so we have to
+        # manually set it from within the bash script in order for the commands
+        # in run lines to see this var:
+        if "DYLD_LIBRARY_PATH" in test.config.environment:
+            f.write(f'export DYLD_LIBRARY_PATH="{test.config.environment["DYLD_LIBRARY_PATH"]}"\n')
+
         for i, ln in enumerate(commands):
             match = re.match(kPdbgRegex, ln)
             if match: