[lldb] Fix TestAppleSimulatorOSType for older watchOS SDKs
authorJonas Devlieghere <jonas@devlieghere.com>
Sat, 27 Mar 2021 03:27:14 +0000 (20:27 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Sat, 27 Mar 2021 03:28:42 +0000 (20:28 -0700)
Older watchOS SDKs *only* support i386 so we can't use x86_64/arm64
unconditionally.

lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py

index c0ec379..f44955a 100644 (file)
@@ -47,9 +47,17 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
 
         # Launch the process using simctl
         self.assertIsNotNone(deviceUDID)
+
         exe_name = 'test_simulator_platform_{}'.format(platform_name)
         sdkroot = lldbutil.get_xcode_sdk_root(sdk)
         vers = lldbutil.get_xcode_sdk_version(sdk)
+
+        # Older versions of watchOS (<7.0) only support i386
+        if platform_name == 'watchos':
+            from distutils.version import LooseVersion
+            if LooseVersion(vers) < LooseVersion("7.0"):
+                arch = 'i386'
+
         triple = '-'.join([arch, 'apple', platform_name + vers, 'simulator'])
         version_min = '-m{}-simulator-version-min={}'.format(platform_name, vers)
         self.build(