Build on Linux: cross-compile for MSVC, run under Wine #195
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/195"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by Naitrate on 2026-11-24T01:18:16Z.
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-msvcwith cargo-xwin and run with VKD3D-Proton and DXVK.shell.nix: the toolchain for Nix users, plusWINEPREFIX, DLL overrides, the test runner, and the VKD3D-Proton/DXVK shader caches kept in the prefix..nixfiles.ws2_32.dlllacksWSAConnectByListandGetAddrInfoExA, and itswinhttp.dlllacksWinHttpGetProxySettingsEx. Forwarding to them panicked (the host lacks ...).WSAConnectByListnow tries each vetted candidate in turn withconnect. It blocks, and the timeout isn't honoured.GetAddrInfoExAanswersWSAHOST_NOT_FOUND, as it already does for a blocked name.WinHttpGetProxySettingsExnever calls the host's function. The export test exempts all three, and a new test covers theconnectfallback.view_formatis#[cfg(windows)], likehost_resource, its only callee. Before this,cargo test --workspacefailed on any non-Windows host withcannot find function host_resource..githooks/pre-commitis executable (100755). Git ignored it on Linux even aftercargo xtask install-hooksreported 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-msvcbuilds.cargo xwin test -p victory-hleunder Wine passes all 87 tests, includingonly_loopback_is_reachable, which panicked before.load_probeandrepository_passes_policy(they startcargoandgitfrom inside Wine), andstub_pipeline_is_created(VKD3D-Proton doesn't check DXIL hashes).buffer_data_reaches_the_host_texture,argument_clamp_buildsanda_rejected_blob_gives_an_empty_libraryfail under VKD3D-Proton. The README lists them.cargo xtask policyand the xtask tests pass natively.Not tested on Windows. Every Rust change is a no-op there except the
WSAConnectByListandGetAddrInfoExAfallbacks, which only run when the host lacks those exports.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:28:28Z.
Review: APPROVED
I checked this out on a second Linux host (Arch, UMU-Proton 11.0-2e, whose prefix ships vkd3d-proton and DXVK) and re-ran the tests. I did not launch the title; this covers the crate tests and the docs only. I could not test on Windows.
Results
Cross-build:
cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-runbuilds all 13 test binaries cleanly at4b38ecf.victory-hle under Proton's wine, at
4b38ecfcompared withmain(d2a4bae):only_loopback_is_reachable:ws2_32.dll lacks WSAConnectByList)connect_by_list_falls_back_to_connect)So the missing-export panic happens on Proton's Wine too, not only on Wine Staging 11.21, and this PR fixes it.
Full workspace under wine with
WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11=n,b": 259 passed and 6 failed. These are the same numbers and the same six tests as in the PR description:load_probe(running cargo: Invalid handle),repository_passes_policy(running git) andstub_pipeline_is_created(digest [00 …] accepted).buffer_data_reaches_the_host_texture(row 0 reads back all zeros),argument_clamp_builds(clamp().is_some()fails) anda_rejected_blob_gives_an_empty_library. Those three also fail on a second vendor/driver stack, so the cause is probably in vkd3d-proton, not this PR.For contrast, without the overrides (Wine's builtin d3d12) those four GPU tests pass. Instead, 7
valu_testsfail withneither hardware nor WARP SM 6.6 device available. That supports the README's point that Wine's own D3D12 is not enough.Native Linux:
#[cfg(windows)]onview_formatworks. Onmain,cargo test -p victory-gpustops atE0425 cannot find function host_resource. On this branch it builds and passes 23 tests.cargo xtask policypasses (152 files)..githooks/pre-commitis now100755in the index.Notes (none of them blocking)
shell.nix, and vkd3d-proton left avkd3d-proton.cachethere. After that,cargo xtask policyfailed withbinary content (NUL bytes).shell.nixalready handles this. The README's plain-Wine steps could add the same two lines (export VKD3D_SHADER_CACHE_PATH=… DXVK_STATE_CACHE_PATH=…) so that people who don't use Nix don't hit it.cargo test --workspaceon non-Windows" claim. The gpu fix works. However, a nativecargo test --workspacestill stops invictory-hle(windows_sys,xmem,lifecycle,filesare not gated; that is #90/#112). Saying "victory-gpu now builds on non-Windows hosts" would be more accurate.connect_each(minor, and only reachable with loopback candidates). If the socket is non-blocking,connectreturnsWSAEWOULDBLOCK, and the code then treats that candidate as failed. The realWSAConnectByListblocks regardless of the socket's mode. The doc comment already says "Blocking; the timeout is not kept". It could also mention that a non-blocking socket will report failure here. Retryingconnecton the same socket afterWSAECONNREFUSEDis allowed by the Winsock docs, so trying the candidates in turn is fine.Overlap with #149
#149 (
docs/linux-proton.mdplus a one-line README pointer) covers host tests, the umu-run/Proton flow, logging throughcmd.exe /c, and the list of open Wine PRs. This PR covers the code fixes,shell.nix, and a plain-Wine section in the README. They mostly complement each other. My suggested merge order is #195 first. #149 would then be rebased on top of it to:host_resource" paragraph, which this PR fixes;If it's useful, this section could later link to
docs/linux-proton.mdfor Proton users, but that can be done in #149.Approving: the code changes are small, are gated so that they only take effect when the host lacks the export, and I reproduced every test number in the description.
Imported from Marvisak/VIctory. Originally posted by ligmaSec on 2026-11-24T01:20:49Z.
duplicate of #191
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T01:27:27Z.
Tested
4b38ecfunder Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build ofvictory-hle: 87 passed, 0 failed, 0 ignored.WSAConnectByListfallback innet.rsfixes the one failure the suite had here (Wine'sws2_32does not export it):modules::net::tests::only_loopback_is_reachablenow passes, and the whole HLE suite is green.#[cfg(windows)]onview_formatand the shell.nix/README additions also apply cleanly.No game data used.
Imported from Marvisak/VIctory. Originally posted by Naitrate on 2026-11-24T01:31:07Z.
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_formatcfg fix and the pre-commit hook's executable bit) will follow in a separate, smaller PR that works with either toolchain.Pull request closed