Loader tests: skip the load_probe cargo build under Wine/Proton #227

Closed
github-bot wants to merge 1 commit from gh-pr/227/head into gh-pr/227/base
Owner

@⁠SkippySteve on GitHub · 2026-11-24 01:38 UTC · original
SkippySteve/victory-pr-load-probe-wine → main · +36 −5 · 1 files · 1 commits · closed without merging

load_probe::loads_binds_and_calls_probe builds its fixture by spawning the cargo that built the test (env!("CARGO")). When the Windows test exe is cross-built on Linux (cargo xwin test) and run by Wine or Proton, that path is a Linux program the guest cannot start, so the test fails with running cargo: ... Invalid handle. on main and on every PR. I hit this while testing #214 (see my comment there). It is a red test that has nothing to do with the change being tested.

Change (test file only)

  • VICTORY_HLE_PROBE_DLL: if set, the test loads that prebuilt hle_probe.dll and does not build one. This works on Windows too.
  • Under Wine (ntdll exports wine_get_version, the same check as in victory-hle/src/modules/xmem.rs) with no prebuilt DLL: the test prints a skipping: ... line and returns.
  • On real Windows nothing changes: it still runs nested cargo and every assertion.

Wine/Proton contributor workflow

cargo xwin test -p victory-loader --target x86_64-pc-windows-msvc --no-run
# optional: run the full end-to-end test under Wine too
cargo xwin build --manifest-path tests/fixtures/hle-probe/Cargo.toml \
  --target x86_64-pc-windows-msvc --target-dir target/fixtures
export VICTORY_HLE_PROBE_DLL="Z:$PWD/target/fixtures/x86_64-pc-windows-msvc/debug/hle_probe.dll"
wine target/x86_64-pc-windows-msvc/debug/deps/load_probe-*.exe

Evidence

Run by UMU-Proton 11.0-2e's wine with a new prefix, on Linux:

tests/load_probe.rs main (d2a4bae) this PR
no env var 1 passed, 1 failed (running cargo: Os { code: 6, ... "Invalid handle." }) 2 passed (prints the skip line)
VICTORY_HLE_PROBE_DLL set — 2 passed, with every assertion run
  • lib unit tests under Wine: 18 passed, 0 failed (no change).
  • cargo xwin clippy -p victory-loader --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean.
  • cargo xtask policy: 151 files ok. Formatted with rustfmt.
  • Native Linux cargo test -p victory-loader: load_probe.rs is #![cfg(windows)], so it is unaffected. The 3 prepare::tests failures there are already on main: they parse their own test binary, which is ELF on Linux. This PR does not change them.

Not tested: a real Windows machine (that code path is the same as before, apart from the env check). No game assets.

**@⁠SkippySteve** on GitHub · 2026-11-24 01:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/227) `SkippySteve/victory-pr-load-probe-wine` → `main` · +36 −5 · 1 files · 1 commits · closed without merging `load_probe::loads_binds_and_calls_probe` builds its fixture by spawning the `cargo` that built the test (`env!("CARGO")`). When the Windows test exe is cross-built on Linux (`cargo xwin test`) and run by Wine or Proton, that path is a Linux program the guest cannot start, so the test fails with `running cargo: ... Invalid handle.` on `main` and on every PR. I hit this while testing #214 (see my comment there). It is a red test that has nothing to do with the change being tested. ### Change (test file only) - **`VICTORY_HLE_PROBE_DLL`**: if set, the test loads that prebuilt `hle_probe.dll` and does not build one. This works on Windows too. - **Under Wine** (ntdll exports `wine_get_version`, the same check as in `victory-hle/src/modules/xmem.rs`) with no prebuilt DLL: the test prints a `skipping: ...` line and returns. - **On real Windows** nothing changes: it still runs nested cargo and every assertion. ### Wine/Proton contributor workflow ```sh cargo xwin test -p victory-loader --target x86_64-pc-windows-msvc --no-run # optional: run the full end-to-end test under Wine too cargo xwin build --manifest-path tests/fixtures/hle-probe/Cargo.toml \ --target x86_64-pc-windows-msvc --target-dir target/fixtures export VICTORY_HLE_PROBE_DLL="Z:$PWD/target/fixtures/x86_64-pc-windows-msvc/debug/hle_probe.dll" wine target/x86_64-pc-windows-msvc/debug/deps/load_probe-*.exe ``` ### Evidence Run by UMU-Proton 11.0-2e's `wine` with a new prefix, on Linux: | `tests/load_probe.rs` | `main` (d2a4bae) | this PR | |---|---|---| | no env var | 1 passed, **1 failed** (`running cargo: Os { code: 6, ... "Invalid handle." }`) | 2 passed (prints the skip line) | | `VICTORY_HLE_PROBE_DLL` set | — | **2 passed, with every assertion run** | - lib unit tests under Wine: 18 passed, 0 failed (no change). - `cargo xwin clippy -p victory-loader --all-targets --target x86_64-pc-windows-msvc -- -D warnings`: clean. - `cargo xtask policy`: 151 files ok. Formatted with rustfmt. - Native Linux `cargo test -p victory-loader`: `load_probe.rs` is `#![cfg(windows)]`, so it is unaffected. The 3 `prepare::tests` failures there are already on `main`: they parse their own test binary, which is ELF on Linux. This PR does not change them. Not tested: a real Windows machine (that code path is the same as before, apart from the env check). No game assets.
The test builds its fixture by running the cargo that built it. A test
exe cross-built on Linux and run by Wine or Proton cannot start that
host program (Invalid handle), so the test failed for a reason that has
nothing to do with the loader. Under Wine it now skips with a message,
unless VICTORY_HLE_PROBE_DLL names a prebuilt hle_probe.dll, which it
loads instead (on Windows too).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:34 +00:00
github-bot closed this pull request 2026-11-26 03:55:34 +00:00
Author
Owner

@⁠MisaXz on GitHub · 2026-11-24 02:27 UTC · original

Test report on real Windows (the description covers Wine and says Windows is unchanged).

Tested

  • Windows 11 Pro 26300 (native, no Wine); Ryzen 7 9800X3D; Rust 1.98.1; debug
  • This PR at e766c61 (base d2a4bae): cargo test --workspace --no-fail-fast: 264 passed, 0 failed, 4 ignored (same as main here).
  • cargo test -p victory-loader --test load_probe -- --nocapture, no env var: 2 passed, no skip line printed, so the nested cargo build still runs here.
  • Same command with VICTORY_HLE_PROBE_DLL set to a hle_probe.dll built with cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target-dir target/fixtures: 2 passed.

Not tested

  • Wine or Proton, a release build, a title (no game files used).

AI use

  • Claude Code (Claude Fable 5.2) ran the tests and wrote this report from their output.
**@⁠MisaXz** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120155965) Test report on real Windows (the description covers Wine and says Windows is unchanged). **Tested** - Windows 11 Pro 26300 (native, no Wine); Ryzen 7 9800X3D; Rust 1.98.1; debug - This PR at `e766c61` (base `d2a4bae`): `cargo test --workspace --no-fail-fast`: 264 passed, 0 failed, 4 ignored (same as `main` here). - `cargo test -p victory-loader --test load_probe -- --nocapture`, no env var: 2 passed, no skip line printed, so the nested cargo build still runs here. - Same command with `VICTORY_HLE_PROBE_DLL` set to a `hle_probe.dll` built with `cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target-dir target/fixtures`: 2 passed. **Not tested** - Wine or Proton, a release build, a title (no game files used). **AI use** - Claude Code (Claude Fable 5.2) ran the tests and wrote this report from their output.
Author
Owner

@⁠Bushyon on GitHub · 2026-11-24 02:27 UTC · original

Tested e766c61 under Wine on Linux, in both modes.

Setup: Fedora 44, RX 7800 XT (RADV 26.2.6). Proton Experimental 11.0-20261112 (wine-11.0), its own prefix. Debug test binaries cross-built for x86_64-pc-windows-msvc with clang-cl, lld-link and xwin (rustc 1.98.1).

cargo test -p victory-loader --test load_probe:

Build Result
main d2a4bae 1 passed, 1 failed (loads_binds_and_calls_probe, panics at load_probe.rs:34, running cargo: ... Invalid handle.)
#227, no prebuilt DLL 2 passed; prints the skipping: under Wine ... line
#227, VICTORY_HLE_PROBE_DLL set 2 passed, no skip line: the full load, bind and call path ran under Wine

For the prebuilt case I built the fixture with cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-msvc (same toolchain) and passed its path as a Z:\... Windows path.

**@⁠Bushyon** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120168943) Tested `e766c61` under Wine on Linux, in both modes. **Setup:** Fedora 44, RX 7800 XT (RADV 26.2.6). Proton Experimental 11.0-20261112 (`wine-11.0`), its own prefix. Debug test binaries cross-built for `x86_64-pc-windows-msvc` with clang-cl, lld-link and xwin (rustc 1.98.1). `cargo test -p victory-loader --test load_probe`: | Build | Result | |---|---| | `main` `d2a4bae` | 1 passed, 1 failed (`loads_binds_and_calls_probe`, panics at `load_probe.rs:34`, `running cargo: ... Invalid handle.`) | | #227, no prebuilt DLL | 2 passed; prints the `skipping: under Wine ...` line | | #227, `VICTORY_HLE_PROBE_DLL` set | 2 passed, no skip line: the full load, bind and call path ran under Wine | For the prebuilt case I built the fixture with `cargo build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-msvc` (same toolchain) and passed its path as a `Z:\...` Windows path.
Author
Owner

@⁠SkippySteve on GitHub · 2026-11-24 02:30 UTC · original

Folded into #232 (same commit cherry-picked onto that branch). Closing as superseded.

**@⁠SkippySteve** on GitHub · 2026-11-24 02:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120210729) Folded into #232 (same commit cherry-picked onto that branch). Closing as superseded.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!227
No description provided.