Tests: allow prebuilt HLE probe DLL via VICTORY_HLE_PROBE_DLL #1630

Open
fuzeofficlal wants to merge 1 commit from upstream-pr/1631 into main
fuzeofficlal commented 2026-11-24 20:06:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T20:06:53Z.


Closes #989.

Summary

  • Factor VICTORY_HLE_PROBE_DLL path resolution into probe_dll_override(Option<&OsStr>) in crates/victory-loader/tests/load_probe.rs so build_probe() uses a prebuilt probe DLL directly when set, falling back to building tests/fixtures/hle-probe via Cargo.

Testing

  • Added in-process unit test probe_dll_override_validates_file_paths covering unset, empty, valid file, missing file, and directory override inputs.
  • cargo test -p victory-loader --locked, cargo clippy, and cargo xtask policy.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5479473317 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T20:06:53Z. --- Closes #989. ### Summary - Factor `VICTORY_HLE_PROBE_DLL` path resolution into `probe_dll_override(Option<&OsStr>)` in `crates/victory-loader/tests/load_probe.rs` so `build_probe()` uses a prebuilt probe DLL directly when set, falling back to building `tests/fixtures/hle-probe` via Cargo. ### Testing - Added in-process unit test `probe_dll_override_validates_file_paths` covering unset, empty, valid file, missing file, and directory override inputs. - `cargo test -p victory-loader --locked`, `cargo clippy`, and `cargo xtask policy`.
catminou4 commented 2026-11-24 22:20:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T22:20:04Z.

Review: COMMENTED


Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

Tests: VICTORY_HLE_PROBE_DLL and GNU delay-load support in the loader probe test harness (load_probe.rs + hle-probe build.rs). Makes the HLE probe testable outside the standard Windows CI path — useful for exactly the kind of cross-platform verification gap we keep hitting. Note: victory-loader tests are currently broken on macOS on main (pre-existing), so this could not be run here.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048313650 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#pullrequestreview-6048313650). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T22:20:04Z. **Review:** COMMENTED --- Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. Tests: VICTORY_HLE_PROBE_DLL and GNU delay-load support in the loader probe test harness (load_probe.rs + hle-probe build.rs). Makes the HLE probe testable outside the standard Windows CI path — useful for exactly the kind of cross-platform verification gap we keep hitting. Note: victory-loader tests are currently broken on macOS on main (pre-existing), so this could not be run here.
acetonahard-code commented 2026-11-24 23:05:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:13:42Z.


Tested on Windows 11 with the repo toolchain, merged into current main (70564ae):

cargo test -p victory-loader passed failed ignored
main 25 0 0
main + this PR 26 0 0
main, --all-features 26 0 -
main + this PR, --all-features 27 0 -
  • The new test passes.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145966697 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#issuecomment-7145966697). Originally posted by [acetonahard-code](https://github.com/acetonahard-code) on 2026-11-24T22:13:42Z. --- Tested on Windows 11 with the repo toolchain, merged into current `main` (70564ae): | `cargo test -p victory-loader` | passed | failed | ignored | |---|---|---|---| | `main` | 25 | 0 | 0 | | `main` + this PR | 26 | 0 | 0 | | `main`, `--all-features` | 26 | 0 | - | | `main` + this PR, `--all-features` | 27 | 0 | - | - The new test passes. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
Marvisak commented 2026-11-25 04:06:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:32:11Z.


Automated triage for the maintainers.

Merge candidate (a recommendation to look, not an approval). The new head is the same test-only change rebased onto current main: build_probe() in crates/victory-loader/tests/load_probe.rs uses a prebuilt fixture DLL from VICTORY_HLE_PROBE_DLL when it is set and non-empty, as #989 asks, and otherwise builds the fixture with cargo as before. probe_dll_override refuses a missing file or a directory, and is tested in-process with tempfile, already a dev-dependency of the crate. No build.rs or process changes remain, and the Wine run in this thread shows the override working.

The branch merges cleanly. CI: check passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152005613 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#issuecomment-7152005613). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:32:11Z. --- <!-- victory-triage v1 head=ee229b3b7818ccbe68876ea0ff24545a0c673c4d verdict=merge-candidate at=2026-11-26T01:19:13Z --> Automated triage for the maintainers. **Merge candidate** (a recommendation to look, not an approval). The new head is the same test-only change rebased onto current `main`: `build_probe()` in `crates/victory-loader/tests/load_probe.rs` uses a prebuilt fixture DLL from `VICTORY_HLE_PROBE_DLL` when it is set and non-empty, as #989 asks, and otherwise builds the fixture with cargo as before. `probe_dll_override` refuses a missing file or a directory, and is tested in-process with `tempfile`, already a dev-dependency of the crate. No `build.rs` or process changes remain, and the Wine run in this thread shows the override working. The branch merges cleanly. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync changed title from [PR #1631] Tests: support VICTORY_HLE_PROBE_DLL and GNU delayload in hle-probe to [PR #1631] Tests: allow prebuilt HLE probe DLL via VICTORY_HLE_PROBE_DLL 2026-11-25 05:05:26 +00:00
fuzeofficlal commented 2026-11-25 05:06:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T04:42:44Z.


Rebased onto 940d32f (5294314c) and dropped both the tests/fixtures/hle-probe/build.rs change and the child-process re-execution in load_probe.rs. The branch now touches only crates/victory-loader/tests/load_probe.rs, factoring VICTORY_HLE_PROBE_DLL resolution into probe_dll_override(Option<&OsStr>) and testing it directly in-process.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153094961 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#issuecomment-7153094961). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T04:42:44Z. --- Rebased onto `940d32f` (`5294314c`) and dropped both the `tests/fixtures/hle-probe/build.rs` change and the child-process re-execution in `load_probe.rs`. The branch now touches only `crates/victory-loader/tests/load_probe.rs`, factoring `VICTORY_HLE_PROBE_DLL` resolution into `probe_dll_override(Option<&OsStr>)` and testing it directly in-process.
astrosteveo commented 2026-11-25 06:02:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by astrosteveo on 2026-11-25T05:44:00Z.


A run on the kind of host this helps (Arch Linux, Wine 11.22, no Rust toolchain inside Wine), 5294314 merged onto main 940d32f:

cargo test -p victory-loader --test load_probe under Wine loads_binds_and_calls_probe
MSVC test build, variable unset fails: it can't run cargo there
MSVC test build, VICTORY_HLE_PROBE_DLL set to an MSVC-built hle_probe.dll passes, and so do the other two tests
x86_64-pc-windows-gnu test build, the same DLL aborts: "current thread handle already set during thread spawn"

So with the variable the test runs under Wine, and it found the DLL from a Z:\ path. I built the DLL with cargo xwin build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-msvc. The fixture does not build for x86_64-pc-windows-gnu here, so there was no GNU DLL to try. I have not looked into the abort; it only happens with the GNU test executable.


Co-Authored-By: Claude Opus 5.5 <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154086259 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#issuecomment-7154086259). Originally posted by [astrosteveo](https://github.com/astrosteveo) on 2026-11-25T05:44:00Z. --- A run on the kind of host this helps (Arch Linux, Wine 11.22, no Rust toolchain inside Wine), `5294314` merged onto `main` `940d32f`: | `cargo test -p victory-loader --test load_probe` under Wine | `loads_binds_and_calls_probe` | |---|---| | MSVC test build, variable unset | fails: it can't run cargo there | | MSVC test build, `VICTORY_HLE_PROBE_DLL` set to an MSVC-built `hle_probe.dll` | passes, and so do the other two tests | | `x86_64-pc-windows-gnu` test build, the same DLL | aborts: "current thread handle already set during thread spawn" | So with the variable the test runs under Wine, and it found the DLL from a `Z:\` path. I built the DLL with `cargo xwin build --manifest-path tests/fixtures/hle-probe/Cargo.toml --target x86_64-pc-windows-msvc`. The fixture does not build for `x86_64-pc-windows-gnu` here, so there was no GNU DLL to try. I have not looked into the abort; it only happens with the GNU test executable. --- <sub>Co-Authored-By: Claude Opus 5.5 &lt;[email protected]&gt;</sub>
cloph-dsp commented 2026-11-27 02:32:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T02:32:26Z.


Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2, no game data).

  • PR head ee229b3, merge base f3578e3.
  • cargo test --locked -p victory-loader --test load_probe -- probe_dll_override_validates_file_paths --exact --test-threads=1 --quiet -> test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out.
  • git diff --check f3578e3 HEAD -> exit 0.
  • Negative control: new test name absent from f3578e3 (git grep -c ... crates/victory-loader/tests/load_probe.rs -> exit 1).

Only the synthetic environment-variable path validation test was replayed; no real prebuilt DLL or game content was used. GPU/driver: N/A (CPU-only loader test). AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7208217597 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1631#issuecomment-7208217597). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T02:32:26Z. --- Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, worktree-local `CARGO_TARGET_DIR`, `CARGO_BUILD_JOBS=2`, no game data). - PR head `ee229b3`, merge base `f3578e3`. - `cargo test --locked -p victory-loader --test load_probe -- probe_dll_override_validates_file_paths --exact --test-threads=1 --quiet` -> `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out`. - `git diff --check f3578e3 HEAD` -> exit 0. - Negative control: new test name absent from `f3578e3` (`git grep -c ... crates/victory-loader/tests/load_probe.rs` -> exit 1). Only the synthetic environment-variable path validation test was replayed; no real prebuilt DLL or game content was used. GPU/driver: N/A (CPU-only loader test). AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1631:upstream-pr/1631'
git switch 'upstream-pr/1631'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1631'
git switch 'upstream-pr/1631'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1631'
git switch 'upstream-pr/1631'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1631'
git switch 'main'
git merge --squash 'upstream-pr/1631'
git switch 'main'
git merge --ff-only 'upstream-pr/1631'
git switch 'main'
git merge 'upstream-pr/1631'
git push origin 'main'
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!1630
No description provided.