Skip to content

Runtime: build the GameInput shim in the Windows CI job - #7179

Closed
HQasper wants to merge 3 commits into
ItsNotRexed:mainfrom
HQasper:gameinput-ci-sdl3
Closed

HQasper wants to merge 3 commits into
ItsNotRexed:mainfrom
HQasper:gameinput-ci-sdl3

Conversation

@HQasper

@HQasper HQasper commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The Runtime windows job never had SDL3, so configure skipped the GameInput shim: CTest listed gameinput as
Not Run (Disabled), and neither gameinput_test nor gameinput_probe was compiled there. #3851's force-feedback
bookkeeping (note_effect, the OutputState effect fields, the probe's --force-feedback path) was therefore never
built in CI, and a change that broke the shim would have left the job green.

Item: new TEST item, claimed in #7049 (2026-11-23).

What changes

  • .github/workflows/runtime.yml: the windows configure passes -DLEONIDA_SDL3_FETCH=ON and a new
    -DLEONIDA_SDL3_REQUIRED=ON. The first uses the pinned, hash-checked SDL3 3.4.20 release the build already
    supports; the second makes a configure without SDL3 fail instead of continuing without the shim. A new step after
    the test list checks that runtime/build/gameinput_test.exe exists and that CTest's gameinput entry has no
    DISABLED property, so the test cannot quietly return to Not Run (Disabled).
  • .github/workflows/runtime.yml (cache): actions/cache for runtime/build/_deps/sdl3-src, sdl3-subbuild and
    sdl3-build, keyed sdl3-3.4.20-<pinned tarball SHA-256>-<salt>-<cl, CMake, Ninja versions>. The pin is a
    job-level env var kept equal to runtime/CMakeLists.txt's URL_HASH; the toolchain versions mean an image update
    starts from an empty cache instead of restoring objects an older toolset built, and the salt is for a change to the
    SDL3 build options, which no version in the key would otherwise notice.
  • runtime/CMakeLists.txt: LEONIDA_SDL3_REQUIRED (default OFF, like LEONIDA_REQUIRE_VULKAN) and a FATAL_ERROR
    in the branch that used to print the "GameInput shim not built" status.
  • docs/gameinput.md: what the CI flags do and why.

Testing

Windows 11 build 26300, VS 18 BuildTools, Ninja, from a checkout at 35b4a8e00. No game files, no controller.

  • -DLEONIDA_SDL3=OFF -DLEONIDA_SDL3_REQUIRED=ON: configure exits 1 with the new message.
  • -DLEONIDA_SDL3=ON -DLEONIDA_SDL3_REQUIRED=ON with the pinned source: configures and builds gameinput_test
    (251 targets, SDL3-static included); the test passes 341 checks, 0 failures, and ctest -R ^gameinput$ passes.
  • The new verify step, taken verbatim from the workflow YAML: exit 0 on that CTest JSON, exit 1 when I inject a
    DISABLED property into the gameinput entry.
  • After the cache change, a fresh configure and build into a new build tree: 251 targets, then gameinput_test again
    341 checks, 0 failures, and ctest -R ^gameinput$ passes.

No GPU path is touched; the machine has an RTX 5090 on driver 621.24, unused for these checks. The job itself is the
remaining check: this PR's windows run should show the shim built on the hosted runner, which also answers whether
SDL's virtual joysticks need anything the runner lacks (the test uses no display and no controller).

Not tested: gameinput_probe against real hardware (it needs a controller), and the Wine job's selected tests, which
do not include gameinput.

AI-assisted.

Leonida local test added 2 commits November 23, 2026 17:06
The windows job never had SDL3, so configure skipped the shim and CTest
listed `gameinput` as Not Run (Disabled): nothing there compiled
gameinput_test or the probe's --force-feedback path, so ItsNotRexed#3851's effect
bookkeeping was never built in CI. Fetch the pinned SDL3 release on that
job and add LEONIDA_SDL3_REQUIRED, which fails the configure instead of
continuing without the shim, plus a step that fails when the test
executable is missing or its CTest entry is disabled.

AI-assisted.
The windows job now compiles SDL3 from the pinned release on every run
that builds the shim. Cache the fetched sources and that build tree,
keyed on the tarball's SHA-256 and cl's version, so a new SDL3 or a new
toolset starts from an empty cache instead of stale objects. Rebuilt
gameinput_test from a fresh tree afterwards: 341 checks, 0 failures.

AI-assisted.
The cached tree holds SDL3 objects and generated files, so reuse it only
for the same cl, CMake and Ninja: their versions go into the key, and a
SDL3_CACHE_SALT covers a change to the build options that no version
would notice. Bump the salt when those options change.

AI-assisted.

@svds12343 svds12343 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent native Windows check of ef61fe8: GameInput builds and passes, with one cache-key finding below.

Windows 11 build 26200, MSVC 19.44.35230, CMake 4.4.5, Ninja 1.13.2, CPython 3.12.5. Synthetic inputs; CPU-only, no controller or game files.

  • Required SDL3 absent (LEONIDA_SDL3=OFF, REQUIRED=ON): configure fails with the intended diagnostic.
  • Pinned SDL3 fetch + REQUIRED=ON: configure succeeds; gameinput_test and gameinput_probe build. CTest gameinput passes, and direct gameinput_test reports 341 checks, 0 failures. The probe was compiled but not run against hardware.
  • Executed the verification step extracted from this workflow: the real build and enabled fixture pass; missing executable, missing test, duplicate test and DISABLED=true fixtures each exit 1.
  • Cache SHA matches CMake's download pin. Executed the version-key step verbatim; it exposed the compiler-version issue below.
  • Clean merge-tree with main 916a2e8; changed-file game-data scan and whitespace check pass.

These are local checks, not a hosted Actions run or a cache restore/save test. No implementation changes made. AI-assisted (Codex).

id: sdl3-toolset
shell: pwsh
run: |
$cl = (& cl 2>&1 | Select-Object -First 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Read a stable compiler version instead of the first merged output line. On native Windows/PowerShell, cl with no arguments emits its usage and banner on different streams; after 2>&1 the first line can be usage: cl [ option... ] filename... [ /link linkoption... ]. Executing this exact step produced version=usage-cl-option...-filename...-link-linkoption...-cmake-version-4.4.5-1.13.2.git.kitware.jobserver-pipe-1, with no compiler version. Repeated captures on the same installed compiler alternated between usage-first and banner-first. Thus unchanged toolchains can get different keys, and compiler changes need not invalidate a usage-based key even though the cache contains generated files and objects. Read the executable's file version, e.g. (Get-Item -LiteralPath (Get-Command cl -CommandType Application).Source).VersionInfo.FileVersion (19.44.35230.0 here), or explicitly select and validate the compiler-version line from the complete output.

@Jadiac5

Jadiac5 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested ef61fe8 on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass, partly. The SDL3 build itself was not tested.

  • MSVC 19.44, CMake 3.31, Ninja, RelWithDebInfo. This machine has no SDL3 and the test may not download it, so I tested the no-SDL3 side only.
  • Configure with no flags: exit 0, "GameInput shim not built" status line as before, and CTest lists gameinput as DISABLED.
  • Configure with -DLEONIDA_SDL3_REQUIRED=ON and no SDL3: exit 1, FATAL_ERROR at runtime/CMakeLists.txt:418 with the new message.
  • Same with -DLEONIDA_SDL3_REQUIRED=ON -DLEONIDA_SDL3=OFF: also exit 1, with the text "SDL3 was not found". That is accurate enough, but the text does not say the cause is the contradicting flag.
  • I ran the new "Verify the GameInput shim and its test" PowerShell logic on the no-SDL3 tree. gameinput_test.exe is missing, so the first check fires. The gameinput entry in ctest --show-only=json-v1 has exactly one match and DISABLED=True, so the second and third checks would fire too.
  • The URL_HASH in runtime/CMakeLists.txt:385 equals SDL3_TARBALL_SHA256 in the workflow.
  • Not done: the -DLEONIDA_SDL3_FETCH=ON configure, the SDL3 build, gameinput_test, the cache step and the workflow YAML itself (no PyYAML, no Actions runner here). Not run against the retail executable.

AI-assisted (Claude Code).

@skorex

skorex commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #7113

#7113 makes the same change and was opened earlier. Topic: CI: build GameInput shim on Windows.

Suggest closing this PR in favour of #7113, and porting anything this one adds that #7113 lacks there.

@HQasper

HQasper commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Verified: #7113 is earlier and makes the same core change.

So the duplicate report is right about the change that makes the test run, and #7113 got there first: that one flag is enough for a clean runner to fetch the pinned SDL3 and for CTest to list gameinput as a real test, which is the outcome this PR was opened for. What #7113 does not have is the guard: if the flag or the target goes away there, its job stays green with the test disabled again, which is the specific failure this PR set out to prevent. It also recompiles SDL3 on every run.

I will not push to another fork, so this is a maintainer call:

  1. Close this PR and port the guard (and the cache, if wanted) to CI: build and test GameInput on Windows #7113 - as a review comment with the patch, or as a follow-up once CI: build and test GameInput on Windows #7113 merges.
  2. Keep this PR as the superset.

Either way the cache-key finding in the review applies to whichever PR carries the cache: reading cl's first merged output line can yield the usage banner, so I would use (Get-Item -LiteralPath (Get-Command cl -CommandType Application).Source).VersionInfo.FileVersion instead.

AI-assisted.

@HQasper

HQasper commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of the earlier #7113.

#7113's single -DLEONIDA_SDL3_FETCH=ON line covers what this PR was opened for: a clean Windows runner fetches the pinned SDL3, builds the shim, and CTest lists gameinput as a real test. It claimed at 15:55:13Z and opened at 15:57:33Z, against 16:06:13Z and 16:07Z here.

The gap is the guard this PR added, so I posted that step alone as a patch on #7113, for its author to apply: #7113 (comment)

Nothing here was pushed to that fork. The SDL3 cache is not offered there: it is a separate change, and it still carries the open P2 on reading cl's version.

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.

4 participants