[compiler-rt] c979d1f - [Sanitizer] Fix android test env issue (#142235)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 30 19:26:30 PDT 2025
Author: Ellis Hoag
Date: 2025-05-30T19:26:26-07:00
New Revision: c979d1f812b542b45dc726305d8788f18bb20702
URL: https://github.com/llvm/llvm-project/commit/c979d1f812b542b45dc726305d8788f18bb20702
DIFF: https://github.com/llvm/llvm-project/commit/c979d1f812b542b45dc726305d8788f18bb20702.diff
LOG: [Sanitizer] Fix android test env issue (#142235)
I attempted to fix android tests in
https://github.com/llvm/llvm-project/pull/142207 (broken by
https://github.com/llvm/llvm-project/pull/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.
(https://github.com/llvm/llvm-project/pull/142234#issuecomment-2923694428)
Added:
Modified:
compiler-rt/test/sanitizer_common/android_commands/android_run.py
Removed:
################################################################################
diff --git a/compiler-rt/test/sanitizer_common/android_commands/android_run.py b/compiler-rt/test/sanitizer_common/android_commands/android_run.py
index f50fc1eb2540d..515939dc5c3db 100755
--- a/compiler-rt/test/sanitizer_common/android_commands/android_run.py
+++ b/compiler-rt/test/sanitizer_common/android_commands/android_run.py
@@ -12,10 +12,13 @@ def build_env():
args = []
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
args.append("LD_LIBRARY_PATH=%s" % (ANDROID_TMPDIR,))
- for (key, value) in list(os.environ.items()):
- if key in ["ASAN_ACTIVATION_OPTIONS", "SCUDO_OPTIONS"] or key.endswith(
- "SAN_OPTIONS"
- ):
+ for key, value in list(os.environ.items()):
+ if key in [
+ "ASAN_ACTIVATION_OPTIONS",
+ "SCUDO_OPTIONS",
+ "HOME",
+ "TMPDIR",
+ ] or key.endswith("SAN_OPTIONS"):
args.append('%s="%s"' % (key, value.replace('"', '\\"')))
return " ".join(args)
More information about the llvm-commits
mailing list