Build: gate Windows-only paths so the workspace builds and tests on Linux #235
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!235
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/235/head"
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?
@SkippySteve on GitHub · 2026-11-24 01:41 UTC · original
linux-workspace-gates→main· +2301 −18 · 25 files · 23 commits · closed without mergingMakes the workspace check, build and test on
x86_64-unknown-linux-gnu. Closes #90.Credit and context
This is the approach from #39 by @LaunchDoesntCode, rebased as a minimal change onto
main(merged up to58fed37). #39 was marked superseded by #112, which is the larger effort (Linux workspace, contributor setup, CI and a bulkcargo fmt). It currently conflicts withmain. This PR doesn't replace #112. It only adds thecfggates, somainbuilds and tests on Linux now and #112 can rebase onto it or drop the overlapping parts.Changes
cfg(windows)gates on the remaining Windows-only paths:view_format(D3D12 host copy) invictory-gpuD3D12XCreateDeviceXLaunchNewGame's relaunchapps/victory/src/translate.rs: on non-Windows hosts, the validator and pipeline checks use an off-host stub that reports them as unavailable.Tests that parse their own test binary as PE, or that depend on Windows path rules, run on Windows only.
No
cfg-induced warnings on Linux. Once the host paths are gated, a Linux build warned about imports, helpers and console-side state that only those paths use:victory-gpu: off Windows only,dead_code,unused_variablesandunused_mutare allowed crate-wide, because the host halves of the objects are gated out there. TheOnceLockimport and the fence/root test modules (every test in them calls host D3D12) are gated.victory-hle: gates theputimport indisplay, thewtest helper inkernel, andXLaunchNewGame's park loop (unreachable afterexitoff Windows). It also allows the Linux-only unusedmutinmodules::alland the unusedhost::function.victory: gates theanyhow::Contextimport that onlyrunuses.Windows behaviour doesn't change. Every change is a
cfggate or a non-Windows stub.victory runon Linux still bails with "running titles requires Windows"..github/workflows/ci.yml: alinuxjob onubuntu-latestnext to the Windows one. It runscargo check --workspace --all-targets --all-features --lockedandcargo test --workspace --locked, so a Windows-only path that leaks into shared code fails on the PR that adds it. It needs no titles or game files. It doesn't run clippy with-D warningsyet: two unused test imports invictory-shader/src/emit/mod.rswarn on Linux, and #326 already removes them.Test plan
Arch Linux, x86_64-unknown-linux-gnu:
cargo check --workspacecargo build --workspacecargo test --workspace: 162 passed, 0 failed, 3 ignoredcargo clippy --workspace --all-targets(with or without--all-features) shows no errors and one warning:constant_colorinvictory-shader/src/emit/mod.rsis never used. This PR deliberately doesn't gate that helper. #326 (which folds in #262) keeps it on every host and adds the hermeticconstant_color_is_a_well_formed_containertest, which clears the warning. Before this PR, Linux showed about 30 warnings.cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc: no new warnings. The two that remain (gpu/host.rssafety comment,hle/xmem.rsfield reassign) are in untouched files and are also onmain.cargo fmt --checkfails onmainin about 30 files that this PR doesn't touch. #112 does the bulk format, so this PR leaves them alone and adds no new drift.cargo xwin build --workspaceand-p victory --releaseforx86_64-pc-windows-msvcpass with no warnings, and the workspace test binaries compile (--no-run). See the comment below.mainexactly, and the 7 failures are Wine/vkd3d or harness gaps (#128, #170, among others). See #235victory configshows the data folder and checks it is outside the repo #277@SkippySteve on GitHub · 2026-11-24 01:43 UTC · original
Windows target check at head
fb59109, cross-compiled from Arch Linux withcargo-xwin(MSVC CRT/SDK via xwin):cargo xwin build -p victory --release --target x86_64-pc-windows-msvcvictory.execargo xwin build --workspace --target x86_64-pc-windows-msvccargo xwin test --workspace --target x86_64-pc-windows-msvc --no-runvictory-loaderload_probe/no_dll_planting,victory-pe,victory-gpu,victory-hle)So the Windows side of every
cfg(windows)gate still compiles cleanly. I compiled the tests but didn't run them, because this machine has no Wine. A native Windowscargo test --workspace(or CI) would still be needed to confirm runtime behaviour, though the PR only addscfggates and doesn't change any Windows code paths.@SkippySteve on GitHub · 2026-11-24 01:48 UTC · original
Windows test binaries under Wine (UMU-Proton 11.0-2e)
I ran the
x86_64-pc-windows-msvcworkspace test binaries under Proton's Wine (wine-11.0). I ran the same binaries frommain(d2a4bae) to compare. This is Wine, not native Windows, so it doesn't replace a native or CI run.Setup:
cargo xwin test --no-run --target x86_64-pc-windows-msvc --workspaceonfb59109. Each.exeran underfiles/bin/winefrom its crate directory, in a fresh prefix. The bare Wine prefix has no D3D12 runtime, so I copied in the DLLs the Proton launcher normally installs: DXVKdxgi/d3d11/d3d10core, vkd3d-protond3d12/d3d12core, and Wine'slibvkd3d*. I ran withWINEDLLOVERRIDES=dxgi,d3d11,d3d10core,d3d12,d3d12core=n,b. GPU: RTX 2060 SUPER. No titles or game assets were used.Result: 257 passed, 7 failed, 4 ignored, the same as
main. The same 7 tests fail on both, so this PR adds no regressions under Wine.load_probeno_dll_plantingFailures. They come from Wine or the test harness, and none of them is in code this PR touches:
victory-gpu indirect::tests::argument_clamp_builds: #170, the argument clamp doesn't compile on vkd3d.victory-gpu resource::tests::buffer_data_reaches_the_host_texture: reads back zeros. This looks like #128, where deferred uploads are skipped under Wine/vkd3d.victory-gpu pipeline::library::tests::a_rejected_blob_gives_an_empty_libraryandvictory-shader emit::tests::stub_pipeline_is_created: vkd3d-proton accepts blobs or digests that native D3D12 rejects, for example a zeroed DXIL digest.victory-hle modules::net::tests::only_loopback_is_reachable: Wine'sws2_32.dlllacksWSAConnectByList.victory-loader load_probe::loads_binds_and_calls_probe: the test runscargowith a LinuxCARGO_MANIFEST_DIRjoined with\..\.., so the host cargo can't find the manifest. This only happens when cross-compiling.xtask policy::tests::repository_passes_policy: there's nogiton the WinePATH.I'm ticking the Windows-tests item with the note "under Wine". A native Windows or CI run is still worth doing before merge.
@CesarLopesO on GitHub · 2026-11-24 01:56 UTC · original
Independent Linux validation — Debian 13
I tested this PR on a separate Debian 13 (Trixie) machine.
Environment
fb59109Command
Result: 162 passed, 0 failed, 3 ignored.
The workspace compiled and all runnable tests completed successfully. The build emitted compiler warnings, including unused/dead-code warnings and an unreachable-expression warning in
crates/victory-hle/src/modules/xgame.rs:94, but no compilation errors.No game files or game data were used.
Thanks for the Linux portability work!
@LazyHatGuy on GitHub · 2026-11-24 02:54 UTC · original
I have verified #235 on Garuda Linux
Environment
16704a564b88d7e2b6b5f0e34c7c375c2b25b0c5Results
cargo fmt --all -- --check-> Reports format issuescargo-summary test --workspace --locked-> TEST OK total=165 passed=162 failed=0 ignored=3 in 5.6scargo xtask policy-> asset policy: 151 files okcargo xtask policy --staged-> asset policy: 0 files ok@pedrofort on GitHub · 2026-11-24 03:20 UTC · original
Independent Apple Silicon validation
Tested on Apple M5, macOS 27.2.1, native ARM64, Rust 1.98.1.
Commit tested:
Check | Result -- | -- Main branch workspace check | FAIL PR workspace check | PASS Workspace build | PASS Workspace tests | 162 passed, 0 failed, 3 ignored Native CLI execution | PASS Empty-directory shader-info | PASS Empty-directory translate | PASS Asset policy | 151 files OK16704a5.The resulting executable is a native Mach-O 64-bit ARM64 binary.
This confirms that the portability changes also enable the offline tools and runnable workspace tests on Apple Silicon, without Rosetta, Wine or virtualization.
No game files were used. Title execution and GPU rendering were not tested.
Thanks for the portability work!
@0xKaji on GitHub · 2026-11-24 14:14 UTC · original
Found a deadlock + 3 test failures in
victory-gpu::queue::host_free_testswhen runningcargo test --workspaceon Linux (CachyOS x86_64,rustc 1.98.1,cargo test --workspace --no-fail-fast, no game data; PR #235head=5d40ad817c).Failure output
Note: because
device::tests::newer_device_levels_are_the_same_devicesorts beforequeue::host_free_tests::*and mutates process-global state, parallel runs (cargo test) can trigger this depending on thread scheduling (which may explain why other Linux runs passed), whereas sequential execution (cargo test -p victory-gpu -- --test-threads=1) runsdevice::tests::*beforequeue::host_free_tests::*.Root cause
device::tests::newer_device_levels_are_the_same_device(crates/victory-gpu/src/device.rs:461) callscreate_as(&LEVEL_IIDS[8]), which flips the process-global atomicdevice::NEWER(device.rs:153-155) totrue.queue::create(crates/victory-gpu/src/queue.rs:57-61) constructs queues with&NEWER_FUNCTIONS, shifting every method atslot >= 14(0x70+) by+2slots (+0x10bytes):signal:0x70 -> 0x80wait:0x78 -> 0x88timestamp_frequency:0x80 -> 0x90copy_page_mappings:0xe8 -> 0xf8present:0xf0 -> 0x100signal2_x:0x100 -> 0x110queue::tests::queue_signals_complete_at_oncealready accounts for this withsignal_slot(q)(queue.rs:472-480: "Another test may switch layouts while this one runs, so the queue's own table decides"), butqueue::host_free_testshardcodes the pre-newervtable byte offsets:timestamp_frequency_refuses_null_and_reports_the_rate(queue.rs:576),slot::<Freq>(q, 0x80)dispatches toqueue::signal(q, fence, value)instead oftimestamp_frequency.freq(q, ptr::null_mut())accidentally returnsE_INVALIDARG(fence.is_null()), and thenfreq(q, &mut out)passes&mut out(a stacku64) asfence: Thisintocrate::fence::signal, which dereferences&Fenceon stack memory and locksfence.waiters(UB / infinite hang).host_free_tests,0x78/0xf0/0xe8hit missing table slots (E_NOTIMPL) and0x100dispatches topresentinstead ofsignal2_x.Suggested fix
Generalize
queue::tests::signal_slotinto a shared helper (e.g.slot_for(q: This, old_offset: usize) -> usize) that inspectsq's own vtable pointer (table == NEWER_FUNCTIONS.0.as_ptr()) and shiftsold_offset >= 0x70by+0x10bytes, and use it inqueue::host_free_tests(0x80,0x78,0x100,0xf0,0xe8) — or invoke the queue's Rust handlers directly inhost_free_tests.@elgreams on GitHub · 2026-11-24 15:07 UTC · original
Tested
5d40ad817on Linux Mint 22.1, rustc 1.98.1: the workspace builds, and every crate passes exceptvictory-gpu. There, 3 of the newqueue::host_free_testsfail andtimestamp_frequency_refuses_null_and_reports_the_ratehangs, but only when they run afterdevice::tests::newer_device_levels_are_the_same_device. Each one passes alone.That test creates the device as
ID3D12Device11, which sets the globalNEWERflag (device.rs:154). Queues created after it use the newer layout, so the fixed offsets inhost_free_tests(0x78, 0x80, 0x100…) land on different methods. Going throughnewer_slot/crate::device::newer(), or not sharing the flag between tests, should fix it. Repro and the other Linux PRs' results: #90@ramenbellic on GitHub · 2026-11-24 17:38 UTC · original
Tested
5d40ad8on Bazzite (kernel 7.3.4, Ryzen 5 5600X, rustc 1.98.1), no game data.cargo check --workspace --all-targets --all-features --locked: passes, 0 warnings.cargo test --workspace --locked --no-fail-fast: hangs in 3 of 3 runs. Everything exceptvictory-gpupasses (226 passed, 0 failed, 5 ignored).cargo test -p victory-gpu: hangs in 6 of 6 runs here (5 parallel, 1 with--test-threads=1), so on this machine it is not scheduling-dependent. 41 pass, the same threequeue::host_free_testsfail as reported above, andtimestamp_frequency_refuses_null_and_reports_the_ratenever returns.--skip newer_device_levels_are_the_same_device: 44 passed, 0 failed, parallel and single-threaded. That supports @elgreams' reading that the globalNEWERflag set by that test is the cause.The new
linuxCI job runscargo test --workspace --locked, so it would hang on this head as it stands.Not tested: Windows, Wine, running a title. AI use: Claude Code (Claude Fable 5.2) ran the commands and drafted this; I checked the results.
@elgreams on GitHub · 2026-11-24 18:46 UTC · original
@SkippySteve I opened SkippySteve/VIctory#2 against this branch with a fix for the order-dependent hang: the
host_free_testsnow find each method in the queue's own table, liketests::signal_slotdoes. On Linux,victory-gpupasses 45/45 in 15 parallel runs.@Marvisak on GitHub · 2026-11-25 00:01 UTC · original
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #523. Linux build gating plus 2,000 lines of Linux-only test modules and a Linux CI job; #523 (clean, 100 lines) gates the same paths without them.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed