Build on Linux: cross-compile for MSVC, run under Wine #195

Closed
github-bot wants to merge 1 commit from gh-pr/195/head into gh-pr/195/base
Owner

@⁠Naitrate on GitHub · 2026-11-24 01:18 UTC · original
Naitrate:linux-wine-build → main · +237 −15 · 6 files · 1 commits · closed without merging

What

VIctory can now be built on Linux and run under Wine. It is still a Windows program: it is cross-compiled for x86_64-pc-windows-msvc with cargo-xwin and run with VKD3D-Proton and DXVK.

  • README: a "Building and running on Linux" section covering the toolchain (rustup, cargo-xwin, clang-cl, lld-link, llvm-lib), a Wine prefix with VKD3D-Proton and DXVK, running the title, and which tests fail under Wine.
  • shell.nix: the toolchain for Nix users, plus WINEPREFIX, DLL overrides, the test runner, and the VKD3D-Proton/DXVK shader caches kept in the prefix.
  • Asset policy: allows .nix files.
  • Wine's missing network functions: Wine's ws2_32.dll lacks WSAConnectByList and GetAddrInfoExA, and its winhttp.dll lacks WinHttpGetProxySettingsEx. Forwarding to them panicked (the host lacks ...).
    • WSAConnectByList now tries each vetted candidate in turn with connect. It blocks, and the timeout isn't honoured.
    • GetAddrInfoExA answers WSAHOST_NOT_FOUND, as it already does for a blocked name.
    • WinHttpGetProxySettingsEx never calls the host's function. The export test exempts all three, and a new test covers the connect fallback.
  • view_format is #[cfg(windows)], like host_resource, its only callee. Before this, cargo test --workspace failed on any non-Windows host with cannot find function host_resource.
  • .githooks/pre-commit is executable (100755). Git ignored it on Linux even after cargo xtask install-hooks reported it as installed.

Why

Wine's own D3D12 rejects the shader model 6.6 query (E_INVALIDARG), so the title shows only a white window. VKD3D-Proton reports SM 6.6–6.8 and runs the translated shaders.

Testing

Tested on NixOS with Wine 11.21 (Staging), VKD3D-Proton 3.0.1, DXVK 3.1.1 and an RTX 5060 Ti:

  • cargo xwin build --release --target x86_64-pc-windows-msvc builds.
  • cargo xwin test -p victory-hle under Wine passes all 87 tests, including only_loopback_is_reachable, which panicked before.
  • The full workspace under Wine passes 259 tests and fails 6:
    • Environment: load_probe and repository_passes_policy (they start cargo and git from inside Wine), and stub_pipeline_is_created (VKD3D-Proton doesn't check DXIL hashes).
    • Not yet explained: buffer_data_reaches_the_host_texture, argument_clamp_builds and a_rejected_blob_gives_an_empty_library fail under VKD3D-Proton. The README lists them.
  • cargo xtask policy and the xtask tests pass natively.
  • The title starts, plays its first screens at 30 fps, and stops after about a minute on one of its own assertions. I'm investigating that separately; this PR doesn't change it.

Not tested on Windows. Every Rust change is a no-op there except the WSAConnectByList and GetAddrInfoExA fallbacks, which only run when the host lacks those exports.

🤖 Generated with Claude Code

**@⁠Naitrate** on GitHub · 2026-11-24 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/195) `Naitrate:linux-wine-build` → `main` · +237 −15 · 6 files · 1 commits · closed without merging ## What VIctory can now be built on Linux and run under Wine. It is still a Windows program: it is cross-compiled for `x86_64-pc-windows-msvc` with cargo-xwin and run with VKD3D-Proton and DXVK. - **README:** a "Building and running on Linux" section covering the toolchain (rustup, cargo-xwin, clang-cl, lld-link, llvm-lib), a Wine prefix with VKD3D-Proton and DXVK, running the title, and which tests fail under Wine. - **`shell.nix`:** the toolchain for Nix users, plus `WINEPREFIX`, DLL overrides, the test runner, and the VKD3D-Proton/DXVK shader caches kept in the prefix. - **Asset policy:** allows `.nix` files. - **Wine's missing network functions:** Wine's `ws2_32.dll` lacks `WSAConnectByList` and `GetAddrInfoExA`, and its `winhttp.dll` lacks `WinHttpGetProxySettingsEx`. Forwarding to them panicked (`the host lacks ...`). - `WSAConnectByList` now tries each vetted candidate in turn with `connect`. It blocks, and the timeout isn't honoured. - `GetAddrInfoExA` answers `WSAHOST_NOT_FOUND`, as it already does for a blocked name. - `WinHttpGetProxySettingsEx` never calls the host's function. The export test exempts all three, and a new test covers the `connect` fallback. - **`view_format` is `#[cfg(windows)]`**, like `host_resource`, its only callee. Before this, `cargo test --workspace` failed on any non-Windows host with `cannot find function host_resource`. - **`.githooks/pre-commit` is executable (100755).** Git ignored it on Linux even after `cargo xtask install-hooks` reported it as installed. ## Why Wine's own D3D12 rejects the shader model 6.6 query (`E_INVALIDARG`), so the title shows only a white window. VKD3D-Proton reports SM 6.6–6.8 and runs the translated shaders. ## Testing Tested on NixOS with Wine 11.21 (Staging), VKD3D-Proton 3.0.1, DXVK 3.1.1 and an RTX 5060 Ti: - `cargo xwin build --release --target x86_64-pc-windows-msvc` builds. - `cargo xwin test -p victory-hle` under Wine passes all 87 tests, including `only_loopback_is_reachable`, which panicked before. - The full workspace under Wine passes 259 tests and fails 6: - Environment: `load_probe` and `repository_passes_policy` (they start `cargo` and `git` from inside Wine), and `stub_pipeline_is_created` (VKD3D-Proton doesn't check DXIL hashes). - Not yet explained: `buffer_data_reaches_the_host_texture`, `argument_clamp_builds` and `a_rejected_blob_gives_an_empty_library` fail under VKD3D-Proton. The README lists them. - `cargo xtask policy` and the xtask tests pass natively. - The title starts, plays its first screens at 30 fps, and stops after about a minute on one of its own assertions. I'm investigating that separately; this PR doesn't change it. Not tested on Windows. Every Rust change is a no-op there except the `WSAConnectByList` and `GetAddrInfoExA` fallbacks, which only run when the host lacks those exports. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
VIctory stays a Windows program; on Linux it is cross-compiled for
x86_64-pc-windows-msvc with cargo-xwin and run under Wine with
VKD3D-Proton and DXVK. The README gains the steps; shell.nix gives Nix
users the toolchain (rustup, cargo-xwin, clang-cl, lld-link, llvm-lib)
and a Wine prefix of VIctory's own. The asset policy allows .nix files.

Wine's ws2_32 lacks WSAConnectByList and GetAddrInfoExA, and its winhttp
WinHttpGetProxySettingsEx. Forwarding to them panicked; now
WSAConnectByList tries each vetted candidate with connect (blocking, the
timeout not kept) and GetAddrInfoExA answers WSAHOST_NOT_FOUND, as for a
blocked name. The export test exempts the three.

view_format is Windows-only like host_resource, its only callee, so the
workspace's host-side crates build natively again.

The pre-commit hook is executable: git skipped it on Linux, where
`cargo xtask install-hooks` said it was installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:54:10 +00:00
github-bot closed this pull request 2026-11-26 03:54:10 +00:00
Author
Owner

@⁠ligmaSec on GitHub · 2026-11-24 01:20 UTC · original

duplicate of #191

**@⁠ligmaSec** on GitHub · 2026-11-24 01:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/195#issuecomment-7119009096) duplicate of #191
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 01:27 UTC · original

Tested 4b38ecf under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build of victory-hle: 87 passed, 0 failed, 0 ignored.

  • The WSAConnectByList fallback in net.rs fixes the one failure the suite had here (Wine's ws2_32 does not export it): modules::net::tests::only_loopback_is_reachable now passes, and the whole HLE suite is green.
  • The #[cfg(windows)] on view_format and the shell.nix/README additions also apply cleanly.
  • This does not touch #128; the GPU upload test is still the only cross-environment GPU failure.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 01:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/195#issuecomment-7119117738) Tested `4b38ecf` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build of `victory-hle`: **87 passed, 0 failed, 0 ignored**. - The `WSAConnectByList` fallback in `net.rs` fixes the one failure the suite had here (Wine's `ws2_32` does not export it): `modules::net::tests::only_loopback_is_reachable` now passes, and the whole HLE suite is green. - The `#[cfg(windows)]` on `view_format` and the shell.nix/README additions also apply cleanly. - This does not touch #128; the GPU upload test is still the only cross-environment GPU failure. No game data used.
Author
Owner

@⁠Naitrate on GitHub · 2026-11-24 01:31 UTC · original

Closing as a duplicate of #191, which covers the Linux build. The parts #191 doesn't include (Wine fallbacks for missing ws2_32 exports, the view_format cfg fix and the pre-commit hook's executable bit) will follow in a separate, smaller PR that works with either toolchain.

**@⁠Naitrate** on GitHub · 2026-11-24 01:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/195#issuecomment-7119177711) Closing as a duplicate of #191, which covers the Linux build. The parts #191 doesn't include (Wine fallbacks for missing ws2_32 exports, the `view_format` cfg fix and the pre-commit hook's executable bit) will follow in a separate, smaller PR that works with either toolchain.

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