Skip to content

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

Closed
SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-load-probe-wine
Closed

SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-load-probe-wine

Conversation

@SkippySteve

Copy link
Copy Markdown

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.

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).
@MisaXz

MisaXz commented Nov 24, 2026

Copy link
Copy Markdown

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

Bushyon commented Nov 24, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

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

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