[Lldb-commits] [lldb] 1447ea0 - NFC test if rosetta is installed before running x86 binary on AS
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 15 14:44:42 PST 2022
Author: Jason Molenda
Date: 2022-11-15T14:44:35-08:00
New Revision: 1447ea059b4ac0995418950c1146fd936d57fee6
URL: https://github.com/llvm/llvm-project/commit/1447ea059b4ac0995418950c1146fd936d57fee6
DIFF: https://github.com/llvm/llvm-project/commit/1447ea059b4ac0995418950c1146fd936d57fee6.diff
LOG: 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.
Added:
Modified:
lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
Removed:
################################################################################
diff --git a/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py b/lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py
index 1c25dc02e5ea3..166b4dfa50b28 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 @@ def test_haswell(self):
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')
More information about the lldb-commits
mailing list