Skip to content

XMA2 CI: link the smoke test with rustc native libraries - #7716

Open
Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/xma2-native-static-libs
Open

Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/xma2-native-static-libs

Conversation

@Barbital11111

Copy link
Copy Markdown
Contributor

XMA2-NATIVE-STATIC-LIBS (claim, finding)

Build the static library with cargo rustc and use its native-static-libs note for the C++ smoke test link. Pass the arguments in order after /link so linker options such as /defaultlib:msvcrt reach MSVC. Compile the smoke test with /MD to match the default Rust MSVC target's CRT.

Depends on: #7506
The two patches overlap in the smoke-test link command and its README. This follow-up gets the library and linker option list from the installed toolchain.

Verification

  • On Windows 11 x64 with Rust 1.95.0 and VS 2022 Build Tools 17.14, ran the workflow's PowerShell blocks locally. Formatting passed, all eight Rust tests passed, and the synthetic C++ ABI smoke test linked and ran with both a fresh and cached Cargo build.
  • The local list included /defaultlib:msvcrt. Before /MD the link emitted LNK4098. With /MD both smoke runs completed without that warning.
  • The branch merged cleanly in a local merge-tree check against dde82f2. git diff --check and check_no_game_data.py passed for both changed files. CPU-only synthetic tests.

AI-assisted (Codex).

@thehollowedone

Copy link
Copy Markdown

Independent native Windows check of 95163e2e with Rust 1.99.1 and MSVC 19.44.

Formatting and all eight Rust tests passed. The C++ ABI smoke test linked with /MD and ran successfully with both a fresh and a cached Cargo build. Each build produced one native-static-libs note in the same order. Neither link emitted LNK4098.

This toolchain's list did not include synchronization.lib, the library added explicitly by #7506. This run verifies the workflow on the toolchain above. Synthetic inputs only. AI-assisted.

@PedroHRamos

Copy link
Copy Markdown

Tested 95163e2e2 on GitHub's own windows-latest runner, through a fork PR run of the XMA2 decoder workflow (base: upstream main dde82f27e): pass. Run: https://github.com/PedroHRamos/Leonida/actions/runs/45231354737

  • Run synthetic Rust FFI tests: success (ok. 2 passed, ok. 6 passed, ok. 0 passed; 0 failed).
  • Link and run the synthetic C++ ABI smoke test: success. rustc's note on the runner was:
    note: native-static-libs: kernel32.lib ntdll.lib userenv.lib ws2_32.lib dbghelp.lib synchronization.lib /defaultlib:msvcrt
    
    This is the toolchain on which [RT-197] Add the XMA2 decoder C ABI boundary #3441's hand-written list failed with LNK2019 on WaitOnAddress/WakeByAddress*. Here it lists synchronization.lib, plus kernel32.lib and dbghelp.lib, which the old list also lacked. @thehollowedone's Rust 1.99.1 list had no synchronization.lib. So the needed list really does differ between toolchains, and reading it from rustc covers both.

Review notes:

  1. Conflict with xma2-decoder workflow: link synchronization.lib into the C++ ABI smoke test #7506 in both orders. The body says Depends on: #7506, but this branch is based on main without xma2-decoder workflow: link synchronization.lib into the C++ ABI smoke test #7506's commit, and both PRs change the same cl line and README sentence. git merge-tree gives content conflicts in both files whichever lands first. The simplest order: xma2-decoder workflow: link synchronization.lib into the C++ ABI smoke test #7506 first (it is the minimal fix the dependency line refers to), then this one rebased onto it, keeping this PR's side of both hunks. I'm xma2-decoder workflow: link synchronization.lib into the C++ ABI smoke test #7506's author, and either order is fine with me. This is only so the maintainer isn't surprised by the conflict.
  2. Nit, optional: -split '\s+' would pass an empty argument to link if the note ever ended in whitespace. It doesn't on this runner, but | Where-Object { $_ } would make that impossible.
  3. I read the diff before running it. Only .github/workflows/xma2-decoder.yml and runtime/xma_decoder/README.md change, and nothing outside the workflow executes code. With this branch, tests/test_docs_*.py, test_ci_registration, test_no_game_data_workflow, test_check_apt_key and test_check_no_game_data give the same results as plain main dde82f27e: all OK except test_docs_cli_flags and test_docs_links, which fail identically on main (docs/dev-tools.md, after BUILD-2248: run a synthetic guest scene with persistent output from the development CLI #6691).

No game files. AI-assisted (Claude Code).

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