forked from OSchip/llvm-project
[Darwin] Apply workaround to make symbolication in iOS simulators work
Specify `ASAN_SYMBOLIZER_PATH` when running simulator tests. This will unblock simulator testing in GreenDragon (Apple's open source testing).
This commit is contained in:
parent
feeff8a37c
commit
ebd8eee62a
|
@ -14,6 +14,7 @@ for e in [
|
||||||
"ASAN_OPTIONS",
|
"ASAN_OPTIONS",
|
||||||
"TSAN_OPTIONS",
|
"TSAN_OPTIONS",
|
||||||
"UBSAN_OPTIONS",
|
"UBSAN_OPTIONS",
|
||||||
|
"LSAN_OPTIONS",
|
||||||
"APPLE_ASAN_INIT_FOR_DLOPEN",
|
"APPLE_ASAN_INIT_FOR_DLOPEN",
|
||||||
"ASAN_ACTIVATION_OPTIONS",
|
"ASAN_ACTIVATION_OPTIONS",
|
||||||
"MallocNanoZone",
|
"MallocNanoZone",
|
||||||
|
@ -21,6 +22,11 @@ for e in [
|
||||||
if e in os.environ:
|
if e in os.environ:
|
||||||
os.environ["SIMCTL_CHILD_" + e] = os.environ[e]
|
os.environ["SIMCTL_CHILD_" + e] = os.environ[e]
|
||||||
|
|
||||||
|
find_atos_cmd = 'xcrun -sdk iphonesimulator -f atos'
|
||||||
|
atos_path = subprocess.run(find_atos_cmd.split(), capture_output=True, check=True).stdout.decode().strip()
|
||||||
|
for san in ['ASAN', 'TSAN', 'UBSAN', 'LSAN']:
|
||||||
|
os.environ[f'SIMCTL_CHILD_{san}_SYMBOLIZER_PATH'] = atos_path
|
||||||
|
|
||||||
prog = sys.argv[1]
|
prog = sys.argv[1]
|
||||||
exit_code = None
|
exit_code = None
|
||||||
if prog == 'rm':
|
if prog == 'rm':
|
||||||
|
@ -39,7 +45,7 @@ if prog == 'rm':
|
||||||
# We use `shell=True` so that any wildcard globs get expanded by the shell.
|
# We use `shell=True` so that any wildcard globs get expanded by the shell.
|
||||||
|
|
||||||
if iossim_run_verbose:
|
if iossim_run_verbose:
|
||||||
print("RUNNING: \t{}".format(rm_cmd_line_str))
|
print("RUNNING: \t{}".format(rm_cmd_line_str), flush=True)
|
||||||
|
|
||||||
exitcode = subprocess.call(rm_cmd_line_str, shell=True)
|
exitcode = subprocess.call(rm_cmd_line_str, shell=True)
|
||||||
|
|
||||||
|
@ -53,7 +59,7 @@ else:
|
||||||
cmd += sys.argv[1:]
|
cmd += sys.argv[1:]
|
||||||
|
|
||||||
if iossim_run_verbose:
|
if iossim_run_verbose:
|
||||||
print("RUNNING: \t{}".format(" ".join(cmd)))
|
print("RUNNING: \t{}".format(" ".join(cmd)), flush=True)
|
||||||
|
|
||||||
exitcode = subprocess.call(cmd)
|
exitcode = subprocess.call(cmd)
|
||||||
if exitcode > 125:
|
if exitcode > 125:
|
||||||
|
|
Loading…
Reference in New Issue