Extend native Switch2Kit controller support to desktop platforms - #5
Conversation
Remove the Apple-only host gate while retaining SDL/Qt requirements and the macOS deployment check. Install the facade with relative runtime paths, provide a build-and-run helper, and compile, install and relocate the full Linux application in CI.
…ecks Fix the full Linux application's unresolved mapping symbols. Exercise the actual platform and backend CMake admission rules for all desktop platforms; remove the unrelated requirement that documentation repeat a literal dependency hash.
Pin the Windows-capable SDK, stage the controller DLL with each desktop executable, add a PowerShell build-and-run helper and a full Windows application workflow with relocation and normal launch/quit/relaunch checks. Remove the checkbox-label assertion; compare the SDK checkout to its actual gitlink rather than duplicating a hash in CI.
Keep Dolphin's compiler guard intact; Windows 2022 supplies an older MSVC toolset. Remove CI-only portable settings from the archive after exercising the unchanged application binaries.
Pin Windows CI to Swift 6.3.3 (LLVM 21) instead of Swift 6.2.1's Clang 19, which the selected VS 2026 STL rejects with STL1000. Retain Dolphin's MSVC guard and the existing native application/relocation checks. Select Visual Studio 2026 and one Swift installation explicitly in the build helper, reject obsolete Swift versions early, and build the actual Swift/C++ WinRT library before the rest of Dolphin. Update desktop toolchain and runtime setup documentation. Local validation: eight integration tests (including production CMake admission cases), four autoconnect wiring tests, and production host/mapping suites with both Clang and GCC under ASan/UBSan. Native Windows qualification remains the responsibility of the full CI build and launch checks.
|
Pushed the Windows toolchain fix in The failing Windows run Changes:
Verified locally: all 8 integration tests (including the production CMake admission cases), all 4 autoconnect wiring tests, and the production host/mapping suites with both Clang and GCC, ASan and UBSan pass. Uploaded blob hashes match those inspected files. Those portable checks are not a native Windows build. Fresh Windows application CI: https://github.com/jmonster/dolphin/actions/runs/35396774396 LLVM version reference: https://github.com/swiftlang/llvm-project/blob/swift-6.3.3-RELEASE/cmake/Modules/LLVMVersion.cmake |
…idth The Swift 6.3.3 run successfully built Switch2KitC.dll, then MSVC /W4 /WX rejected the adapter's implicit size_t-to-uint32_t event capacity. Advance only to a dedicated one-file SDK fix based directly on the previous pin; no unrelated SDK changes. Compile the real adapter with a test-only deleted overload enforcing uint32_t at that call boundary on 64-bit hosts. The regression fails on the old source and passes on the fixed source with both Clang and GCC. Run both compilers in wiring CI while retaining native Windows application, relocation, and launch checks.
|
The first fix is confirmed at the native-library level: Windows run Pushed Validation at this head:
MSVC Fresh Windows run: https://github.com/jmonster/dolphin/actions/runs/35398281931 Windows and Linux are still building at the latest check. Fresh full application results remain outstanding; successful DLL compilation and regression tests alone are not a passing Dolphin application build or hardware qualification. The PR remains draft, with no merge or force-push. |
* Fix Switch2Kit Windows builds selecting incompatible VS 2026 tools * Run pinned Swift 6.2.1 Windows CI on compatible VS 2022 image * Guard Windows Swift/MSVC compatibility without weakening native CI coverage
Advance only Externals/Switch2Kit to immutable commit 06bc206047e9b5c9d3f07940e9a7ce29a7de366d. Both Windows Swift 6.2.1 and 6.3.3 passed real C/SDL consumers and extracted packages at this SDK revision, including OS-only PATH, isolated profiles and missing-DLL negative controls. The same revision passed Linux BlueZ/native hosts and macOS runtime checks. The previous divergent 9b2e7dc SDK fix was reviewed rather than discarded blindly. The current SDK passes Tools/test_switch2kit_capacity.py against the real adapter and pinned SDL headers; its unsigned ABI capacity constant preserves the MSVC narrowing fix. Preserve the newly landed 4ca2766 toolchain regression checks and all other host work unchanged. Fresh native Dolphin CI is required after this pin update. SDK consumer success is not application or physical-controller qualification. Merge the SDK with this reviewed commit retained/reachable before merging this host change; a squash/rebase requires repinning to the resulting SDK commit and revalidation.
…GUIs The Windows parent target copied Switch2KitC.dll alone, never invoking the SDK runtime packager. A developer PATH could hide the incomplete application. Stage the facade's compiler-selected dependency closure and required Swift/ICU notices in the shared output directory before the C++ hosts link. Preserve SDK unresolved-dependency failures, all existing host deployment rules, macOS behavior and disabled-build isolation. Install Sys beside the Linux executable for File::GetSysDirectory's existing relocatable lookup instead of depending on a build-time absolute data directory. Add four executable native deployment-graph regressions. With the original production CMake, three fail: omitted runtime, ignored invalid runtime configuration and absent relocatable resources. With this repair all four pass, including launching three real linked fixture executables after removing the original build/compiler locations and rejecting a missing packaged runtime. These fixtures do not replace the actual Windows application. Both desktop workflows now archive first and qualify the exact extracted application through the pinned SDK GUI supervisors: isolated profile, no compiler PATH, packaged controller/Swift modules, normal window quit and relaunch. Preserve reports on failure and upload the same application archive only after success. Existing profiles are rejected from CI staging, not erased from a user configuration. Update the README and controller guide with platform-specific application artifacts, extraction/executable paths, runtime prerequisites, source fallbacks, Find/Sync and port selection, saved identity, opt-in automatic reconnection and Joy-Con/Wii-motion distinctions. Do not claim notarization or physical-controller qualification. Validation: every changed blob matches the locally reviewed files; all retained mapping/host sanitizer, auto-connect, exact-capacity and current toolchain wiring checks pass, as do four new deployment tests. YAML parses and local documentation targets resolve. Fresh native enabled/disabled/application CI is required for this commit; prior-head results are not final qualification. SDK remains pinned to 06bc206047e9b5c9d3f07940e9a7ce29a7de366d.
…ithout Swift Remove the dedicated clang-format UI presentation gate. Keep exact ABI-width compilation, mapping/rollback and host sanitizer tests, opt-in reconnect guards, native SDK regressions, and both complete macOS applications and extracted-launch checks unchanged. This is editorial-test cleanup, not suppression of a compiler or product failure. Add a separate real Dolphin Linux application build with ENABLE_SWITCH2KIT=OFF in plain ubuntu:24.04, installing normal C++/Qt dependencies but no Swift. Reject the image if Swift appears, build the full dolphin-emu target, and inspect its resolved native dependencies to ensure no Switch2Kit/Swift runtime was pulled in. Preserve diagnostics, do not upload the disabled executable as a controller-enabled application, and leave the enabled extracted-GUI job required. Local current toolchain/wiring regressions (11), automatic-connection guards (4), and YAML parsing pass; both uploaded blobs exactly match reviewed local files. The new full no-Swift build remains a native CI check, not a local fixture pass. No application or SDK code/pin changes.
Advance Externals/Switch2Kit to immutable 5198ca5a5fb9e39657832951d8751ad1e9472a4c, matching Cemu. The SDK product sources and Windows runtime/transport are unchanged; this revision fixes the isolated Linux observer's Openbox identity/client-list readiness race, demonstrated by Cemu's real extracted application job. It adds seven failure-oriented portable tests and a native owned-X11 reproduction without relaxing GUI, shutdown, runtime-location or timeout requirements. Dolphin 3a5adad already passed exact extracted Linux GUI startup, normal quit and relaunch with every controller/Swift library loaded from its package; the downloaded application tarball matches the report SHA-256 034111e143104ec16dff9185f6c2a2026587ce4f96b5dc7ef30159a256aeefbb. That is recorded as prior-pin evidence, not a substitute for fresh final-pin validation. Preserve the complete no-Swift disabled build, all controller/toolchain regressions, Windows runtime/resource repair and user guides. Only the gitlink changes. Keep the reviewed SDK commit reachable through merge and revalidate both maintained forks if a squash/rebase selects a different SDK commit.
…file repair The final disabled application built and linked without Swift at e700798. Its --version process then failed because Qt initialized xcb without a display. Run that smoke probe with Qt's offscreen platform and a disposable private user/config/cache directory. Preserve the separate extracted enabled application's real visible-window, dependency-origin, normal shutdown and relaunch gates. Select the explicit bash runner so configure/build pipelines fail when the native command fails rather than allowing tee to hide its status. Pin Externals/Switch2Kit to reviewed immutable 8a6ff6f7ed0763849e53a6bcf47c38cdd6e22ad7, matching Cemu. That SDK revision fixes the PowerShell read-only HOME collision found in Dolphin's hash-verified Windows diagnostic archive and adds native supervisor preparation/failure tests for both hosts. It does not weaken GUI or controller qualification. The prior-head Windows complete application build and Linux complete disabled build are diagnostic evidence, not final-pin qualification. Fresh native Linux/Windows/macOS checks remain required. No physical controller or pristine first-use qualification is claimed.
…robe fix Correct the preceding workflow replacement using the original e700798 workflow whose blob content was independently verified as e382ab3. An earlier connector response supplied a different workflow. Keep the existing Ubuntu 24.04 enabled application job, separate ubuntu:24.04 image without Swift, retained controller policy tests, exact archive names, build-root denial, extracted GUI/runtime/quit/relaunch supervisor and diagnostic uploads unchanged. The net change from that verified workflow is only a private HOME/user/config/cache and QT_QPA_PLATFORM=offscreen for the disabled application's --version smoke probe. It does not replace enabled GUI qualification. The SDK gitlink remains 8a6ff6f7ed0763849e53a6bcf47c38cdd6e22ad7, matching Cemu. Validation: original blob hash verified, updated YAML parsed, both original jobs retained, and all run blocks pass bash syntax validation. Final native CI remains required.
Advance only Externals/Switch2Kit to immutable 3d3ce3a605733c47db061af687168ad5914cbf0c, coordinated with Cemu. A connection can retire after its controller advertised during continuous discovery; the old per-scan duplicate filter then suppressed all fresh advertisements until an unrelated scan restart. The SDK now clears the retired identity's admission, while leaving actual discovery/retry, consent and explicit-stop policy in the shared transport. Three new executable adaptation regressions preserve stale-token rejection, stable identity, bounded scanning and explicit stop/shutdown. Two fail against the old adapter and pass with the repair; all ten Windows adaptation tests pass in the local production-source proof. Native WinRT and final maintained-fork GUI/package CI are required for this new pin. Retain all prior runtime/resource, CRT-capacity, mapping/rollback and opt-in auto-reconnect work; preserve the corrected Ubuntu 24.04 enabled and no-Swift disabled jobs. Do not treat earlier-pin results as final revision qualification.
… conflicts Preserve the controller-settings grouping and immediate user-action refresh from c6527dc alongside the desktop integration and setup documentation. Retain behavioral UI guards without restoring prose or hardcoded SDK-pin assertions removed by the desktop work. SDK and SDL pins, compiler guards, and native application qualification workflows are unchanged. Validated 11 integration checks, six autoconnect/UI checks, production capacity/host/mapping regressions with Clang and GCC (ASan/UBSan for host and mapping), and four executable deployment tests. The new action-refresh regression fails against the pre-merge UI and passes with this resolution. Native application CI still needs to validate this exact merged tree. Prepared with AI assistance; no console emulation or transport changes.
|
Pushed the conflict resolution as ae632e5 (tree Diagnosis and repairThe failed Intel macOS job 105921928697 never reached compilation. Checkout encountered GitHub network timeouts: cloning There was also a separate merge conflict after master gained the controller-settings UI update in #7. The resolution preserves that complete UI update, its immediate state refresh after explicit Find/Stop/automatic-connect actions, this PR's desktop setup instructions, and both sets of behavioral tests. The SDK pin remains Local validationValidated against the hash-verified source artifact for the previous head plus the resolved files:
These portable checks are not a full native Dolphin application build or hardware acceptance result. Fresh CI for ae632e5
The |
Resolve the README conflict with f203bcd, preserving the project name, controller screenshot and source-first macOS setup alongside the desktop platform guide. Explain that Find or opted-in automatic connection starts discovery; Sync alone does not start a stopped backend. Only Readme.md changes relative to ae632e5. Production code, tests, SDK/SDL pins and CI workflows are unchanged. Verified locally on Linux: 101 Swift tests with warnings as errors; 11 integration, 6 autoconnect and 4 deployment tests; Clang/GCC capacity and ASan/UBSan host/mapping tests; actual SDL/Swift in-process and motion consumers normally and with C++ ASan/UBSan; C ABI and host-file consumers; 10 applicable native runtime-staging tests (2 Windows-only tests skipped); rumble/scheduling/GameCube motor regressions; 20 isolated BlueZ scenarios. Full Dolphin application configuration was blocked by missing desktop development dependencies in the offline sandbox. These results are not native macOS/Windows application or physical-controller qualification. Prepared with AI assistance.
|
Completed direct local verification and pushed ae7f587 (tree Master advanced through Tests executed locally, not inferred from CIEnvironment: Debian 13 x86_64, Swift 6.2.1, Clang 17, GCC 14.2, CMake 3.31.6 and Ninja.
All test processes completed with exit code 0. No runtime-code failure was reproduced, and no tests were modified to obtain these results. Source identity and limitsVerified the source-only input archive SHA-256 A full Dolphin GUI configuration was also attempted, but the offline sandbox lacks The local stdout/stderr logs, commands and source manifest are provided with the chat response in |
Scope and current revision
This maintained Dolphin fork embeds Switch2Kit through its existing SDL3 input backend on macOS, Linux and Windows. No separate dashboard, network bridge, system SDL override or virtual-controller driver is required. Ordinary upstream Dolphin binaries do not contain this integration.
Current head:
ae7f587644390e926d0d149151da2d86fda0fb50.Tree:
1bb2b216e820d4e4d4ea7513e218bba118abd8bf.Externals/Switch2Kit:3d3ce3a605733c47db061af687168ad5914cbf0c(unchanged).The branch incorporates the controller-settings UI update and subsequent README edits from master, preserving the project name, screenshot, local-build instructions and desktop setup documentation. The latest update relative to
ae632e5changes only Readme.md; production code, tests, dependency pins and workflows are unchanged.Product, lifecycle and distribution
Recommended GameCube/Pro mappings, independent GameCube analog travel and digital clicks, model-appropriate rumble, saved physical assignments and explicit custom-mapping replacement/backup/rollback remain. Automatic reconnection is opt-in and off by default. Explicit disconnect stays stopped for the current session. The controller-settings group refreshes immediately after explicit actions. Joy-Con 2 halves retain manual bindings; the GameCube shortcut does not configure Wii motion or supply measured calibration.
Local validation
Detailed commands, results and limitations are recorded in the preceding validation comments. Locally executed results include 101 Swift tests with warnings treated as errors; 11 Dolphin integration checks, six autoconnect/UI checks and four executable deployment/runtime/resource tests; production capacity checks with Clang and GCC; production host/mapping tests with Clang and GCC under ASan/UBSan; and all three native SDL consumer tests both normally and with sanitizers. Native C ABI and host-file consumers, runtime staging, isolated BlueZ and rumble/scheduling regressions were also exercised.
The complete local Dolphin GUI configuration was attempted but blocked by unavailable Xi/OpenGL/Qt development dependencies in the sandbox. This limitation is not a request for the owner to repeat work: the existing native application workflows cover full builds, packaging and extracted GUI launches. Portable fixtures and source archives are not substitutes for those application checks.
Automated application checks for ae7f587
At the latest check, source provenance passed; the application/native workflows were running or queued. The four workflows contain eight expected jobs. Links to earlier heads in prior comments are historical and do not establish this head's final CI result.
Application qualification archives before testing, makes original staging/build paths unavailable to the tested launch, extracts into a new location, uses private profiles, verifies loaded controller/Swift library origins, observes a GUI, requests normal close and relaunches. The identical application archive is uploaded only after success. Compiler guards, sanitizer coverage, runtime/license checks and these native application gates remain enabled.
Merge decision — owner authorized
The owner has explicitly authorized merging this PR when its automated tests pass, without another confirmation. Physical-controller testing is out of scope and is NOT a merge requirement. Hardware acceptance, production signing/notarization and release preparation are not additional gates for this PR. These instructions supersede the earlier draft/remaining-gate language.
The PR is ready for review, no longer draft. GitHub native auto-merge is disabled for this repository; a separate hourly conditional merge task has been created. It will verify all eight current-head jobs pass, check for an actual conflict or blocking review, merge with an expected-head-SHA guard, verify the result and report completion. It must not merge on pending/failed checks or weaken tests. No additional discretionary approval round is required.
This change does not claim physical pairing/gameplay acceptance or production signing/notarization, and it does not publish a release. Those are scope boundaries, not unfinished work blocking this merge.