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

Closed
SkippySteve wants to merge 1 commit from upstream-pr/227 into main
SkippySteve commented 2026-11-24 01:38:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:38:07Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6572627443 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/227). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:38:07Z. --- `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.
upstream-sync closed this pull request 2026-11-24 06:51:55 +00:00
MisaXz commented 2026-11-24 06:55:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MisaXz on 2026-11-24T02:27:07Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7120155965 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120155965). Originally posted by [MisaXz](https://github.com/MisaXz) on 2026-11-24T02:27:07Z. --- 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.
Bushyon commented 2026-11-24 06:55:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Bushyon on 2026-11-24T02:27:51Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120168943 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120168943). Originally posted by [Bushyon](https://github.com/Bushyon) on 2026-11-24T02:27:51Z. --- 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.
SkippySteve commented 2026-11-24 06:55:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T02:30:21Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7120210729 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/227#issuecomment-7120210729). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T02:30:21Z. --- Folded into #232 (same commit cherry-picked onto that branch). Closing as superseded.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!227
No description provided.