Skip to content

Loader: VICTORY_HLE_PROBE names a prebuilt hle-probe fixture - #3270

Open
neonbyte1 wants to merge 2 commits into
Marvisak:mainfrom
neonbyte1:pr/hle-probe
Open

neonbyte1 wants to merge 2 commits into
Marvisak:mainfrom
neonbyte1:pr/hle-probe

Conversation

@neonbyte1

Copy link
Copy Markdown

Split out of #1218, as the maintainer triage asked, so that PR stays about the Wine test runner.

crates/victory-loader/tests/load_probe.rs builds the tests/fixtures/hle-probe fixture by running cargo from inside the test. Under Wine, the test process can't start the host's cargo, which isn't a Windows executable. With this change, VICTORY_HLE_PROBE, when set, names an already-built hle_probe.dll, and the test uses it directly. When it's unset, nothing changes.

One commit, one file; no fixture, runner or docs changes.

Tested under Wine (vkd3d-proton, Linux, RTX 5090) with the fixture cross-built on the host: loads_binds_and_calls_probe and maps_a_title_dll_the_title_loads_itself pass. Windows-target clippy (with and without --all-features) and cargo xtask policy pass. Not run on native Windows, where the variable is unset and the test path is the one on main.

AI-assisted (Claude); measured on my machine, no game data shared.

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff and verified locally on Windows 11 x64:

  • Allowing VICTORY_HLE_PROBE to point to a prebuilt hle-probe fixture cleanly avoids nested cargo invocations in environments like Wine while keeping the default build path unchanged.
  • cargo test -p victory-loader --test load_probe -- --test-threads=1: 2 passed, 0 failed.
  • cargo clippy -p victory-loader --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

@Jackster

Copy link
Copy Markdown

Windows 11, 63bcca4 + this PR:

  • cargo test -p victory-loader --test load_probe: 2 passed (0.31 s), which is the default path (the test builds the fixture itself).
  • Then I removed the fixture's build tree (target/tmp/hle-probe), kept a copy of the built hle_probe.dll, set VICTORY_HLE_PROBE to it and re-ran: 2 passed in 0.09 s and the fixture build tree was not recreated. So the override really does skip the inner cargo, which is the case this adds for Wine runners.
  • cargo clippy -p victory-loader --all-targets -- -D warnings: clean.

Synthetic only. AI-assisted.

@neonbyte1

Copy link
Copy Markdown
Author

@Jackster thanks for checking both paths. Removing the fixture's build tree and confirming it isn't recreated with VICTORY_HLE_PROBE set is exactly the case this is for.

AI-assisted (Claude); no game data shared.

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Clean and minimal way to reuse a prebuilt hle_probe.dll in environments where running nested cargo isn't possible.

Verified:

  • cargo xtask policy and cargo clippy --tests -p victory-loader -- -D warnings pass cleanly.
  • cargo test --locked -p victory-loader --test load_probe passes (2/2) both with VICTORY_HLE_PROBE unset (builds fixture) and with VICTORY_HLE_PROBE pointing to the prebuilt hle_probe.dll (skips nested cargo build).

(Minor optional note): on Unix/Wine runners where an empty env var (VICTORY_HLE_PROBE=) can exist, .filter(|p| !p.is_empty()) would fall back to building rather than returning an empty PathBuf.

@neonbyte1

Copy link
Copy Markdown
Author

@fuzeofficlal thanks for the review. Took the optional note in 711b2d5c: VICTORY_HLE_PROBE set but empty now falls back to building the fixture (.filter(|p| !p.is_empty())), and the doc comment says so. Clippy (--tests, Windows target, -D warnings) and rustfmt are clean. The tests are Windows-only, so on Linux this is compile-checked; the empty-variable path itself is the usual nested-cargo build, which only a native Windows run exercises.

AI-assisted (Claude); no game data shared.

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.

4 participants