Loader tests: run the delay-load probe with LLVM-MinGW and Wine #2684

Closed
github-bot wants to merge 1 commit from github-bot/gh-2684 into main AGit
Owner

@⁠SinisterRob on GitHub · 2026-11-25 18:08 UTC · original
loader/mingw-probe → main · +11 −2 · 2 files · 1 commits · closed without merging

The loader probe builds a synthetic title with normal and delay-load imports. The fixture uses the MSVC linker spelling for delay loading, so an LLVM-MinGW cross-build cannot link it. The test also invokes the host's Cargo from inside the test process, which cannot start Linux Cargo under Wine.

Use the LLVM-MinGW linker's delay-load spelling on the LLVM Windows GNU target. For Wine, accept a prebuilt fixture via VICTORY_HLE_PROBE, the same hook as #1218. Native MSVC tests still build the fixture on demand.

On Linux with Rust 1.98.1, LLVM-MinGW and Wine 11.22, I built the fixture and test binaries for x86_64-pc-windows-gnullvm, then ran all four loader test binaries. 38 passed, 0 failed. This includes ordinary and delay-loaded imports, title DLL binding and thread notifications. The fixture is entirely synthetic. AI-assisted.

**@⁠SinisterRob** on GitHub · 2026-11-25 18:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/2684) `loader/mingw-probe` → `main` · +11 −2 · 2 files · 1 commits · closed without merging The loader probe builds a synthetic title with normal and delay-load imports. The fixture uses the MSVC linker spelling for delay loading, so an LLVM-MinGW cross-build cannot link it. The test also invokes the host's Cargo from inside the test process, which cannot start Linux Cargo under Wine. Use the LLVM-MinGW linker's delay-load spelling on the LLVM Windows GNU target. For Wine, accept a prebuilt fixture via `VICTORY_HLE_PROBE`, the same hook as #1218. Native MSVC tests still build the fixture on demand. On Linux with Rust 1.98.1, LLVM-MinGW and Wine 11.22, I built the fixture and test binaries for `x86_64-pc-windows-gnullvm`, then ran all four loader test binaries. **38 passed, 0 failed.** This includes ordinary and delay-loaded imports, title DLL binding and thread notifications. The fixture is entirely synthetic. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:58 +00:00
github-bot closed this pull request 2026-11-26 06:30:48 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 18:38 UTC · original

Both parts are right: CARGO_CFG_TARGET_ABI llvm is the correct discriminator for the MinGW delay-load spelling (lld takes --delayload, MSVC /DELAYLOAD), and reusing the VICTORY_HLE_PROBE prebuilt hook keeps Wine runners out of the nested-cargo problem.

**@⁠kotekompotek** on GitHub · 2026-11-25 18:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2684#issuecomment-7171179658) Both parts are right: CARGO_CFG_TARGET_ABI llvm is the correct discriminator for the MinGW delay-load spelling (lld takes --delayload, MSVC /DELAYLOAD), and reusing the VICTORY_HLE_PROBE prebuilt hook keeps Wine runners out of the nested-cargo problem.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:19 UTC · original

Independent Windows 11 MSVC verification and review of 9e539d84 (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo clippy --locked -p victory-loader --all-targets -- -D warnings: 0 warnings.
  • cargo test --locked -p victory-loader: 34 passed (lib), crash_log (1), load_probe (2), title_dlls (1), 0 failed — confirms native MSVC /DELAYLOAD probe build and execution are unchanged.

Review Notes

  • Switching tests/fixtures/hle-probe/build.rs on CARGO_CFG_TARGET_ABI == "llvm" cleanly keeps MSVC /DELAYLOAD: intact while enabling LLVM-MinGW -Wl,--delayload=, and VICTORY_HLE_PROBE cleanly bypasses nested cargo invocation under Wine.
  • Merge-ordering note: #1631 (already triage: merge candidate) also modifies crates/victory-loader/tests/load_probe.rs and tests/fixtures/hle-probe/build.rs (using VICTORY_HLE_PROBE_DLL), so the two PRs will overlap there if both land.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2684#issuecomment-7172144700) Independent Windows 11 MSVC verification and review of `9e539d84` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `cargo clippy --locked -p victory-loader --all-targets -- -D warnings`: **0 warnings**. - `cargo test --locked -p victory-loader`: **34 passed** (`lib`), `crash_log` (1), `load_probe` (2), `title_dlls` (1), **0 failed** — confirms native MSVC `/DELAYLOAD` probe build and execution are unchanged. ### Review Notes - Switching `tests/fixtures/hle-probe/build.rs` on `CARGO_CFG_TARGET_ABI == "llvm"` cleanly keeps MSVC `/DELAYLOAD:` intact while enabling LLVM-MinGW `-Wl,--delayload=`, and `VICTORY_HLE_PROBE` cleanly bypasses nested `cargo` invocation under Wine. - Merge-ordering note: #1631 (already `triage: merge candidate`) also modifies `crates/victory-loader/tests/load_probe.rs` and `tests/fixtures/hle-probe/build.rs` (using `VICTORY_HLE_PROBE_DLL`), so the two PRs will overlap there if both land.
Author
Owner

@⁠Kajanos on GitHub · 2026-11-25 20:43 UTC · original

Linux / Wine run of the prebuilt-probe path, head 9e539d8487 merged onto main 13f91caee2.

Setup: Linux (Gentoo) / wine-proton 11.0.3, RTX 5080; cross-built with cargo-xwin for x86_64-pc-windows-msvc, rustc 1.98.1.

  • On main, loads_binds_and_calls_probe fails under Wine with running cargo: Os { code: 6, ... "Invalid handle." } because the test can't start cargo from inside Wine.
  • With this PR and no VICTORY_HLE_PROBE set, it fails the same way, as expected.
  • I built the fixture beforehand with cargo xwin build --target x86_64-pc-windows-msvc --manifest-path tests/fixtures/hle-probe/Cargo.toml and set VICTORY_HLE_PROBE=Z:\...\hle_probe.dll. The load_probe test binary then passes 2/2 under Wine.

Not run: the LLVM-MinGW (-Wl,--delayload) branch of build.rs. I only built the fixture with MSVC (/DELAYLOAD). Not run on Windows.

AI-assisted (Claude Code)

**@⁠Kajanos** on GitHub · 2026-11-25 20:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2684#issuecomment-7174097361) **Linux / Wine run of the prebuilt-probe path**, head `9e539d8487` merged onto `main` `13f91caee2`. Setup: Linux (Gentoo) / wine-proton 11.0.3, RTX 5080; cross-built with cargo-xwin for `x86_64-pc-windows-msvc`, rustc 1.98.1. - On `main`, `loads_binds_and_calls_probe` fails under Wine with `running cargo: Os { code: 6, ... "Invalid handle." }` because the test can't start cargo from inside Wine. - With this PR and no `VICTORY_HLE_PROBE` set, it fails the same way, as expected. - I built the fixture beforehand with `cargo xwin build --target x86_64-pc-windows-msvc --manifest-path tests/fixtures/hle-probe/Cargo.toml` and set `VICTORY_HLE_PROBE=Z:\...\hle_probe.dll`. The `load_probe` test binary then passes 2/2 under Wine. Not run: the LLVM-MinGW (`-Wl,--delayload`) branch of `build.rs`. I only built the fixture with MSVC (`/DELAYLOAD`). Not run on Windows. AI-assisted (Claude Code)
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:17 UTC · original

Automated triage for the maintainers.

Needs work; needs the maintainer's decision. The change is small and reads correctly: tests/fixtures/hle-probe/build.rs picks -Wl,--delayload= on the LLVM ABI and keeps /DELAYLOAD: otherwise, and build_probe in crates/victory-loader/tests/load_probe.rs takes a prebuilt fixture from VICTORY_HLE_PROBE. Two things stop it from being a plain merge candidate:

  • It edits a build.rs (the fixture's linker arguments) to support a Linux/LLVM-MinGW/Wine test setup. Build-script changes and whether that setup is a supported target are the maintainer's call.
  • The prebuilt-fixture half overlaps #1631 (VICTORY_HLE_PROBE_DLL, already triaged as a merge candidate), which edits the same two files. Two env-var names for the same hook should not both land. Rebasing onto whichever lands first, or reducing this PR to the delay-load spelling only, would settle it.

CI: check passing on this head.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2684#issuecomment-7176177548) <!-- victory-triage v1 head=9e539d848790f005ec2a900f02357bd3834142db verdict=needs-work at=2026-11-25T22:18:30Z --> Automated triage for the maintainers. **Needs work; needs the maintainer's decision.** The change is small and reads correctly: `tests/fixtures/hle-probe/build.rs` picks `-Wl,--delayload=` on the LLVM ABI and keeps `/DELAYLOAD:` otherwise, and `build_probe` in `crates/victory-loader/tests/load_probe.rs` takes a prebuilt fixture from `VICTORY_HLE_PROBE`. Two things stop it from being a plain merge candidate: - It edits a `build.rs` (the fixture's linker arguments) to support a Linux/LLVM-MinGW/Wine test setup. Build-script changes and whether that setup is a supported target are the maintainer's call. - The prebuilt-fixture half overlaps #1631 (`VICTORY_HLE_PROBE_DLL`, already triaged as a merge candidate), which edits the same two files. Two env-var names for the same hook should not both land. Rebasing onto whichever lands first, or reducing this PR to the delay-load spelling only, would settle it. CI: `check` passing on this head. --- _Generated by [Claude Code](https://claude.ai/code)_

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!2684
No description provided.