Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
frontend-qt: upgrade pinned iPhoneOS SDK to 27.2 and allow in-place upgrade from 26.x
LNPANDYb26d8c156ae3
diff --git a/frontend-qt/nspb_qt/model.py b/frontend-qt/nspb_qt/model.pyindex 65ccfa38..2e777ef5 100644--- a/frontend-qt/nspb_qt/model.py+++ b/frontend-qt/nspb_qt/model.py@@ -527,7 +527,8 @@ class Model(QObject):detail = p.pathelif p.state == 'wrong':detail = p.detail- install = [] if p.ok else ['__win__:ios_sdk']+ can_upgrade = p.ok and wtc.sdk_major(p.version) < wtc.sdk_major(wtc.SDK_PINNED[8:-4])+ install = ['__win__:ios_sdk'] if (not p.ok or can_upgrade) else []out.append(Dep('ios_sdk', 'dep.iossdk', 'dep.iossdk.hint', state(p), detail,install=install, pick_key='' if p.ok else 'ios_sdk'))diff --git a/frontend-qt/nspb_qt/ui.py b/frontend-qt/nspb_qt/ui.pyindex 2652643c..e96c3ce7 100644--- a/frontend-qt/nspb_qt/ui.py+++ b/frontend-qt/nspb_qt/ui.py@@ -1676,7 +1676,7 @@ class MainWindow(QMainWindow):col.addWidget(sub)r.addLayout(col, 1)- if not d.ok and d.install:+ if d.install and (not d.ok or d.id == 'ios_sdk'):b = QPushButton(t('dep.installing') if d.installing else t('dep.install'))b.setEnabled(not d.installing)b.clicked.connect(lambda _=False, dep=d: self.m.install_dep(dep))diff --git a/frontend-qt/nspb_qt/win/toolchain.py b/frontend-qt/nspb_qt/win/toolchain.pyindex 0596a805..69d76f4f 100644--- a/frontend-qt/nspb_qt/win/toolchain.py+++ b/frontend-qt/nspb_qt/win/toolchain.py@@ -122,15 +122,18 @@ def git_exe() -> Path | None:return Path(found) if found else None#: The iPhoneOS SDK we pin. `xybp888/iOS-SDKs` is a plain git repository of SDK trees, so a-#: shallow clone is enough and the commit SHA pins the content. 26.0 is what `dm/ios/project.yml`-#: targets; 26.5 is accepted too, since a newer SDK still compiles against 26.0.+#: shallow clone is enough and the commit SHA pins the content. 27.2 matches the upstream+#: Xcode 27.2 engine headers while targeting the 26.0 deployment floor; 26.x SDKs remain+#: accepted with the `win/ios/sdk_compat` fallback headers.SDK_REPO = 'https://github.com/xybp888/iOS-SDKs'-SDK_PINNED = 'iPhoneOS26.0.sdk'-SDK_ACCEPTED = ('iPhoneOS26.0.sdk', 'iPhoneOS26.1.sdk', 'iPhoneOS26.2.sdk', 'iPhoneOS26.3.sdk',- 'iPhoneOS26.4.sdk', 'iPhoneOS26.4.1.sdk', 'iPhoneOS26.5.sdk')+SDK_PINNED = 'iPhoneOS27.2.sdk'+SDK_ACCEPTED = ('iPhoneOS27.2.sdk', 'iPhoneOS27.1.sdk', 'iPhoneOS27.0.sdk',+ 'iPhoneOS26.5.sdk', 'iPhoneOS26.4.1.sdk', 'iPhoneOS26.4.sdk',+ 'iPhoneOS26.3.sdk', 'iPhoneOS26.2.sdk', 'iPhoneOS26.1.sdk',+ 'iPhoneOS26.0.sdk')#: Commit of `xybp888/iOS-SDKs` the pinned SDK was read from. Informational: the SDK tree is#: verified by its own layout and a caller-supplied hash, not by trusting this number.-SDK_PINNED_COMMIT = '17eb9152ba9779b27427016472758824a8fcd6a7'+SDK_PINNED_COMMIT = '4a48e5409f8ea6ac422c44d91b86fa0f8ae010ff'#: .NET SDK. `dm/tools/nx_extract` targets net10.0 and the shader translator's runtimeconfig is#: net10.0, so 10 is the floor; a newer major (11) can still build a net10.0 project as long as@@ -1018,7 +1021,9 @@ def probe_metal(sdk: Path) -> tuple[bool, str]:a = Path(td) / 'probe.air'lib = Path(td) / 'probe.metallib'm.write_text(src, encoding='utf-8')- tgt = f'air64-apple-ios{sdk_major(sdk_version(sdk)[0]) or IOS_DEPLOYMENT.split(".")[0]}.0'+ dep_maj = int(IOS_DEPLOYMENT.split('.')[0])+ maj = min(sdk_major(sdk_version(sdk)[0]) or dep_maj, dep_maj)+ tgt = f'air64-apple-ios{maj}.0'for cmd, what in (([str(metal), '-target', tgt, '-c', str(m), '-o', str(a)], 'metal'),([str(metallib), str(a), '-o', str(lib)], 'metallib')):try:diff --git a/frontend-qt/tests/test_win.py b/frontend-qt/tests/test_win.pyindex 3603cf76..83c57ada 100644--- a/frontend-qt/tests/test_win.py+++ b/frontend-qt/tests/test_win.py@@ -213,6 +213,34 @@ class SdkTest(unittest.TestCase):self.assertEqual(tc.sdk_tree_digest(a), tc.sdk_tree_digest(a))self.assertNotEqual(tc.sdk_tree_digest(a), tc.sdk_tree_digest(b))+ def test_sdk_pinned_is_27_2_and_preferred_over_cached_26(self) -> None:+ self.assertEqual(tc.SDK_PINNED, 'iPhoneOS27.2.sdk')+ self.assertEqual(tc.SDK_ACCEPTED[0], 'iPhoneOS27.2.sdk')+ cache = tc.sdk_cache_dir()+ sdk26 = make_fake_sdk(cache, '26.0')+ with mock.patch.object(tc, 'setting', return_value=None):+ self.assertEqual(tc.ios_sdk(), sdk26)+ sdk27 = make_fake_sdk(cache, '27.2')+ self.assertEqual(tc.ios_sdk(), sdk27)++ def test_probe_metal_caps_target_at_deployment_for_27_sdk(self) -> None:+ sdk27 = make_fake_sdk(self.root, '27.2')+ seen_cmds: list[list[str]] = []++ def fake_run(cmd, *a, **kw):+ seen_cmds.append([str(c) for c in cmd])+ if '-o' in cmd:+ out_p = Path(cmd[cmd.index('-o') + 1])+ out_p.write_bytes(b'MTLB')+ return subprocess.CompletedProcess(cmd, 0, '', '')++ with mock.patch.object(tc, 'metal_tool', side_effect=lambda name, *a: Path(f'C:/metal/{name}.exe')), \+ mock.patch.object(tc.subprocess, 'run', side_effect=fake_run):+ ok, detail = tc.probe_metal(sdk27)+ self.assertTrue(ok, detail)+ self.assertIn('air64-apple-ios26.0', seen_cmds[0])+ self.assertNotIn('air64-apple-ios27.0', seen_cmds[0])+class CheckAllTest(unittest.TestCase):"""The panel's rows, on a machine with nothing installed and with a fake toolchain."""