BUILD-XMA2-OPT-IN: gate configure-time Cargo XMA2 build behind -DLEONIDA_XMA2_DECODER=ON (#963) #995

Open
github-bot wants to merge 2 commits from github-bot/gh-995 into main AGit
Owner

@⁠markankamaransheogarat-sys on GitHub · 2026-11-24 16:38 UTC · original
markankamaransheogarat-sys:ubiq/cmake-xma2-opt-in → main · +32 −3 · 3 files · 2 commits · open

Summary

  • Addresses the supply-chain note in #963: runtime/CMakeLists.txt previously ran cargo build (fetching github.com/omonkeyz/xbox-emulator) at CMake configure time whenever cargo was on PATH.
  • Adds option(LEONIDA_XMA2_DECODER "Build the Rust XMA2 decoder at configure time" OFF) and gates find_program(LEONIDA_CARGO cargo) + execute_process(...) on if(LEONIDA_XMA2_DECODER OR LEONIDA_REQUIRE_XMA2_DECODER).
  • .github/workflows/runtime.yml already passes -DLEONIDA_REQUIRE_XMA2_DECODER=ON, so CI continues to build and require the decoder unchanged.
  • Updates runtime/xma_decoder/README.md and adds tests/test_cmake_xma2_opt_in.py.

Verification

  • python3 -I tests/test_cmake_xma2_opt_in.py: 1/1 passed.
  • python3 -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/xma_decoder/README.md tests/test_cmake_xma2_opt_in.py: passed.

AI-assisted: yes (no game files).

**@⁠markankamaransheogarat-sys** on GitHub · 2026-11-24 16:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/995) `markankamaransheogarat-sys:ubiq/cmake-xma2-opt-in` → `main` · +32 −3 · 3 files · 2 commits · open ### Summary - Addresses the supply-chain note in #963: `runtime/CMakeLists.txt` previously ran `cargo build` (fetching `github.com/omonkeyz/xbox-emulator`) at CMake configure time whenever `cargo` was on `PATH`. - Adds `option(LEONIDA_XMA2_DECODER "Build the Rust XMA2 decoder at configure time" OFF)` and gates `find_program(LEONIDA_CARGO cargo)` + `execute_process(...)` on `if(LEONIDA_XMA2_DECODER OR LEONIDA_REQUIRE_XMA2_DECODER)`. - `.github/workflows/runtime.yml` already passes `-DLEONIDA_REQUIRE_XMA2_DECODER=ON`, so CI continues to build and require the decoder unchanged. - Updates `runtime/xma_decoder/README.md` and adds `tests/test_cmake_xma2_opt_in.py`. ### Verification - `python3 -I tests/test_cmake_xma2_opt_in.py`: 1/1 passed. - `python3 -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/xma_decoder/README.md tests/test_cmake_xma2_opt_in.py`: passed. AI-assisted: yes (no game files).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:32:27 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 16:42 UTC · original · approved these changes

Reviewed exact head b30db4175e12f200f571a2ff74de6bc147c8a181. On latest main 82a2aabcc, the new Python regression passed 1/1, docs links 16/16, no-game-data scan and diff check passed. I also configured the Windows-only CMake branch in a disposable Fedora 45 environment with a fake Cargo executable: with LEONIDA_XMA2_DECODER=OFF, configure completed and Cargo was not invoked; with the option ON, it invoked Cargo and tolerated the simulated build failure when not required; with LEONIDA_REQUIRE_XMA2_DECODER=ON, the same failure stopped configuration as required. This tests the gating and required-mode behavior, not a real Rust/XMA2 build or Windows runtime. Hosted checks were queued at review time.

**@⁠KernelSmoker** on GitHub · 2026-11-24 16:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/995#pullrequestreview-6043476864) · **approved these changes** Reviewed exact head b30db4175e12f200f571a2ff74de6bc147c8a181. On latest main 82a2aabcc, the new Python regression passed 1/1, docs links 16/16, no-game-data scan and diff check passed. I also configured the Windows-only CMake branch in a disposable Fedora 45 environment with a fake Cargo executable: with `LEONIDA_XMA2_DECODER=OFF`, configure completed and Cargo was not invoked; with the option ON, it invoked Cargo and tolerated the simulated build failure when not required; with `LEONIDA_REQUIRE_XMA2_DECODER=ON`, the same failure stopped configuration as required. This tests the gating and required-mode behavior, not a real Rust/XMA2 build or Windows runtime. Hosted checks were queued at review time.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/995/head:github-bot/gh-995'
git switch 'github-bot/gh-995'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-995'
git switch 'github-bot/gh-995'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-995'
git switch 'github-bot/gh-995'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-995'
git switch 'main'
git merge --squash 'github-bot/gh-995'
git switch 'main'
git merge --ff-only 'github-bot/gh-995'
git switch 'main'
git merge 'github-bot/gh-995'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.