Skip to content

Commit

Permalink
scope to only DYLD env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Aug 23, 2024
1 parent ca7c8aa commit 268e4b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/utils/lit/lit/TestRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,9 +1227,13 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
if test.config.pipefail:
f.write(b"set -o pipefail;" if mode == "wb" else "set -o pipefail;")

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

0 comments on commit 268e4b1

Please sign in to comment.