From 1447ea059b4ac0995418950c1146fd936d57fee6 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 15 Nov 2022 14:43:20 -0800 Subject: [PATCH] NFC test if rosetta is installed before running x86 binary on AS Rosetta 2 is not installed by default in a fresh macOS installation on Apple Silicon, so x86 binaries cannot be run. CI bots are often in this state. Update this test to check for the rosetta debugserver, which our debugserver also hardcodes the path of, before trying to run an x86 process on AS systems. --- lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py b/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py index 1c25dc0..166b4df 100644 --- a/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py +++ b/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py @@ -1,5 +1,6 @@ import contextlib import os +from os.path import exists import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * @@ -16,6 +17,9 @@ def apple_silicon(): return "Apple M" in features.decode('utf-8') +def rosetta_debugserver_installed(): + return exists("/Library/Apple/usr/libexec/oah/debugserver") + class TestLaunchProcessPosixSpawn(TestBase): NO_DEBUG_INFO_TESTCASE = True @@ -56,5 +60,6 @@ class TestLaunchProcessPosixSpawn(TestBase): def test_apple_silicon(self): self.build() exe = self.getBuildArtifact("fat.out") - self.run_arch(exe, 'x86_64') + if rosetta_debugserver_installed(): + self.run_arch(exe, 'x86_64') self.run_arch(exe, 'arm64') -- 2.7.4