Skip to content

Commit b172924

Browse files
committed
scope to only DYLD env vars
1 parent 975b067 commit b172924

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/utils/lit/lit/TestRunner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,9 +1227,13 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
12271227
if test.config.pipefail:
12281228
f.write(b"set -o pipefail;" if mode == "wb" else "set -o pipefail;")
12291229

1230+
# Manually export any DYLD_* variables used by dyld on macOS because
1231+
# otherwise they are lost when the shell executable is run, before the
1232+
# lit test is executed.
12301233
env_str = "\n".join(
12311234
"export {}={};".format(k, shlex.quote(v))
12321235
for k, v in test.config.environment.items()
1236+
if k.startswith("DYLD_")
12331237
)
12341238
f.write(bytes(env_str, "utf-8") if mode == "wb" else env_str)
12351239
f.write(b"set -x;" if mode == "wb" else "set -x;")

0 commit comments

Comments
 (0)