Skip to content

Commit c979d1f

Browse files
authored
[Sanitizer] Fix android test env issue (#142235)
I attempted to fix android tests in #142207 (broken by #141820). They are still failing but now I have more info. https://lab.llvm.org/buildbot/#/builders/186/builds/9504/steps/16/logs/stdio ERROR: Can't open file: //foo.8862 (reason: 30) I believe the reason is that on android the HOME and TMPDIR environment variables are not being set correctly, or they are not read correctly. (#142234 (comment))
1 parent 4d48673 commit c979d1f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

compiler-rt/test/sanitizer_common/android_commands/android_run.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ def build_env():
1212
args = []
1313
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
1414
args.append("LD_LIBRARY_PATH=%s" % (ANDROID_TMPDIR,))
15-
for (key, value) in list(os.environ.items()):
16-
if key in ["ASAN_ACTIVATION_OPTIONS", "SCUDO_OPTIONS"] or key.endswith(
17-
"SAN_OPTIONS"
18-
):
15+
for key, value in list(os.environ.items()):
16+
if key in [
17+
"ASAN_ACTIVATION_OPTIONS",
18+
"SCUDO_OPTIONS",
19+
"HOME",
20+
"TMPDIR",
21+
] or key.endswith("SAN_OPTIONS"):
1922
args.append('%s="%s"' % (key, value.replace('"', '\\"')))
2023
return " ".join(args)
2124

0 commit comments

Comments
 (0)