Skip to content

CI: build and test GameInput on Windows - #7113

Open
Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:ci/windows-gameinput-sdl3
Open

Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:ci/windows-gameinput-sdl3

Conversation

@Barbital11111

Copy link
Copy Markdown
Contributor

Coordination claim · Original finding.

Enable LEONIDA_SDL3_FETCH in the Windows Runtime job. A clean runner can use the existing SHA-256-pinned SDL 3.4.20 static build, which adds the real gameinput CTest to the normal Windows test step and compiles the manual gameinput_probe target.

Validation

  • Windows 11, MSVC 19.44.35225, CMake 3.31.6, Ninja 1.12.1. With the option off, ctest -N -R '^gameinput$' listed gameinput (Disabled).
  • With the option on, CMake fetched the pinned SDL. cmake --build <build> --target gameinput_test gameinput_probe linked both targets. ctest --test-dir <build> --output-on-failure --no-tests=error -R '^gameinput$' passed 1/1 in 3.4 s using virtual joysticks.
  • Parsed the workflow and confirmed the Windows configure flag is its only change. git diff --check and the changed-file no-game-data check passed.
  • test_runtime_paths.py ran 5 tests with one existing path-filter failure (tools/replace_retry.py, tracked by CI: the runtime workflow's path filter lists tools/replace_retry.py (test_runtime_paths red since #2721) #7029).

CPU-only local validation. GitHub-hosted Windows and Wine execution and physical controller behavior remain unverified. AI-assisted (Codex).

@philip-roy-jones

philip-roy-jones commented Nov 23, 2026 •

Copy link
Copy Markdown

I tested 6910be57 on Windows 11 Pro 25H2 with my Xbox Series X controller connected by USB. I built gameinput_probe and gameinput_test with MSVC 19.51, Ninja, -DLEONIDA_SDL3_FETCH=ON and the pinned static SDL 3.4.20.

I ran gameinput_probe --seconds 2 twice. Both times the shim opened one physical gamepad, SDL named it Xbox One Controller, and GetCurrentReading returned a gamepad reading. Both runs exited 0. I matched the device to the XInput interface under the USB controller in Windows. Its paired Bluetooth LE endpoint was disconnected during both checks.

The separate virtual-joystick gameinput CTest also passed (1/1). AI-assisted verification.

I then unplugged USB and connected the same controller over Bluetooth LE. Windows reported one connected Bluetooth controller and no wired Xbox controller before and after the probes. The same build identified it as Xbox Series X Controller and returned a current gamepad reading in both two-second runs. Both exited 0.

@HQasper

HQasper commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Patch for the one thing this PR leaves out, if you want it: the job can stay green with the test disabled again after the flag is removed or the target stops building. It applies to 6910be57 unchanged - no configure flag, your -DLEONIDA_SDL3_FETCH=ON line is untouched.

It goes after "List tests for Wine", which already writes runtime/build/ctest.json for the Wine job, and fails the run when gameinput_test.exe is missing, when CTest does not list exactly one gameinput test, or when that test carries a DISABLED property - the three ways the test can stop running silently.

Checked while detached at 6910be57: git apply succeeds (one line of offset), the YAML parses, and the step sits between "List tests for Wine" and "Upload the Windows build for Wine". Not run on a hosted runner. Save it as gameinput-guard.patch and apply it with git apply gameinput-guard.patch, or take the step text only - it is self-contained.

diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml
index e2c34d062..0e82dbe8f 100644
--- a/.github/workflows/runtime.yml
+++ b/.github/workflows/runtime.yml
@@ -269,6 +269,23 @@ jobs:
         run: |
           ctest --test-dir runtime/build --show-only=json-v1 > runtime/build/ctest.json
           cygpath -m "$GITHUB_WORKSPACE" > runtime/build/windows-root.txt
+      # The shim is built only when SDL3 was found. This checks the built tree, so the test cannot quietly
+      # return to "Not Run (Disabled)" with the job green.
+      - name: Verify the GameInput shim and its test
+        shell: pwsh
+        run: |
+          $exe = 'runtime/build/gameinput_test.exe'
+          if (!(Test-Path -LiteralPath $exe -PathType Leaf)) {
+            throw "The GameInput shim was not built: $exe is missing (SDL3 was not available)"
+          }
+          $tests = (Get-Content -LiteralPath 'runtime/build/ctest.json' -Raw | ConvertFrom-Json).tests
+          $gameinput = @($tests | Where-Object { $_.name -eq 'gameinput' })
+          if ($gameinput.Count -ne 1) {
+            throw "CTest lists $($gameinput.Count) tests named 'gameinput', expected exactly one"
+          }
+          if (@($gameinput[0].properties | Where-Object { $_.name -eq 'DISABLED' }).Count -gt 0) {
+            throw "The 'gameinput' test is DISABLED: the GameInput shim was not built, so it was not tested"
+          }
       - name: Upload the Windows build for Wine
         id: upload-wine-artifact
         uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2

Your call whether it is worth it; without it this PR still makes gameinput_test run, it just cannot notice if it stops.

AI-assisted.

@HQasper

HQasper commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The cache now has its own PR: #7882, Depends on: #7113.

It is one file and independent of your branch: job env SDL3_TARBALL_SHA256 (the same SHA-256 as URL_HASH) and SDL3_CACHE_SALT, a step that reads cl's file version, cmake --version and ninja --version for the key, and actions/cache for runtime/build/_deps/sdl3-{src,subbuild,build}. cl is read from the executable's VersionInfo.FileVersion rather than its first output line, which is the P2 that #7179's review found: with the old read one unchanged toolchain produced version=usage-cl-option...-... on some runs.

Until your flag is in, the paths do not exist and the cache saves nothing; after it, the windows job stops rebuilding all of SDL3 (a C build, and the job's sccache launcher is CXX-only) on every push. Nothing was pushed to your branch and the guard patch above is unchanged - that one and this remain separable.

AI-assisted.

HQasper pushed a commit to HQasper/Leonida that referenced this pull request Nov 23, 2026
Fold the three versions into one assignment instead of a temporary plus
an inline replace, and drop the ItsNotRexed#7113 note from the workflow comment so it
does not outlive the dependency. The key segment is unchanged:
version=19.51.36260.0-cmake-version-4.3.1-msvc1-1.13.2, twice.

AI-assisted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants