Repository navigation
Build: gate Windows-only paths so the workspace builds and tests on Linux - #235
SkippySteve wants to merge 23 commits into
Conversation
Gate the remaining Windows-only paths so the workspace checks, builds and tests on x86_64-unknown-linux-gnu: view_format (D3D12 host copy), the xgameui host dialog, the xmem allocator hookup in D3D12XCreateDevice, XLaunchNewGame's relaunch, and translate's validator/pipeline checks (stubbed as unavailable). Tests that parse their own test binary as PE or rely on Windows path rules run on Windows only. victory run still bails with 'running titles requires Windows'.
|
Windows target check at head
So the Windows side of every |
Windows test binaries under Wine (UMU-Proton 11.0-2e)I ran the Setup: Result: 257 passed, 7 failed, 4 ignored, the same as
Failures. They come from Wine or the test harness, and none of them is in code this PR touches:
I'm ticking the Windows-tests item with the note "under Wine". A native Windows or CI run is still worth doing before merge. |
Independent Linux validation — Debian 13I tested this PR on a separate Debian 13 (Trixie) machine. Environment
Command cargo test --workspace --lockedResult: 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 No game files or game data were used. Thanks for the Linux portability work! |
With the host paths gated, a Linux build warned about the imports, helpers and console-side state only those paths use. Gate or allow them off Windows so `cargo clippy --workspace --all-targets` on Linux reports only real issues: - victory-gpu: off Windows, allow dead_code/unused_variables/unused_mut crate-wide (the host halves of the objects are gated out); gate the OnceLock import and the host-only fence/root test modules. - victory-hle: gate the `put` import in display, the `w` test helper, and XLaunchNewGame's park loop (unreachable after exit off Windows); allow the unused `mut` in modules::all and the unused host::function. - victory: gate the anyhow::Context import used only by `run`. Windows behaviour and Windows warnings are unchanged.
cf5a95d to
16704a5
Compare
|
I have verified #235 on Garuda Linux Environment
rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)Results
|
Independent Apple Silicon validationTested on Apple M5, macOS 27.2.1, native ARM64, Rust 1.98.1. Commit tested: 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! |
Formatting the crates touched unrelated sources; restore them.
The synthetic PE gains a delay-import descriptor (its own IAT, checked against SizeOfImage like the ordinary one), forwarders by name and by ordinal, the relocation/exception/load-config directory flags with RELOCS_STRIPPED, every subsystem name, and the CodeView symbol key.
The storage test mounts a drive and is gated to Windows. This one checks, on any host, that the path calls fail untouched without a drive, that used space counts files at any depth but not links (a loop ends, an outside target is not charged), the exact-rest prompt grant, and a quota shrunk under saved data, set to zero, or a storage path naming a file.
The display test takes a host power request and is gated to Windows. This one checks, on any host, that each display pair resolves to its object and crossed pairs do not, that HDR stays SDR for any preference without writing the info, that URIs and screenshots fail as unsupported, that the shell table ends at the launch slot off Windows, and that the diagnostic capture slots are unimplemented rather than crashes.
Off Windows, `run` refuses a title for every console and unimplemented mode before reading it, and `translate` refuses validation and pipelines before walking while translation alone still walks unreadable roots. The host stand-ins (validator, device, stub vertex shader, every pipeline kind) each report themselves unavailable.
Off Windows the host source reports every pad slot empty and no key down, and rumble is a no-op, so a hub over it connects only the keyboard and its idle stand-in pad: the four pad slots answer disconnected, the stand-in reads at rest and the keyboard reads no keys.
The device-type key was gated to Windows whole, though only its fallthrough to the host's advapi32 needs Windows. Off Windows there is no host registry behind our key: other keys are missing and handles we never gave out are refused. The key's tests now run on any host, with new edges for size-only, type-only and data-without-size probes, a null value name and a null subkey.
Co-authored-by: Cursor <cursoragent@cursor.com>
The host-only paths stay gated; these cover argument refusals for device creation, tiled page-pool registration, committed and address-backed resources, and null pipeline descriptions on any host. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Found a deadlock + 3 test failures in Failure outputNote: because Root cause
Suggested fixGeneralize |
|
Tested That test creates the device as |
|
Tested
The new 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. |
|
@SkippySteve I opened SkippySteve/VIctory#2 against this branch with a fix for the order-dependent hang: the |
|
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. |
Makes 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 Shaders: DXBC/DXIL parser and sampler/SP3 robustness fixes #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. Shaders: DXBC/DXIL parser and sampler/SP3 robustness fixes #326 (which folds in Shaders: check the constant-colour container's layout and hash on every host #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. Build: Linux workspace, contributor setup and CI #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 (Wine/vkd3d: deferred uploads are skipped because VirtualQuery() reports mapped memory as MEM_FREE #128, Wine/vkd3d: indirect execution is dropped because the argument clamp cannot be compiled there; rewriting its HLSL does not help #170, among others). See Build: gate Windows-only paths so the workspace builds and tests on Linux #235 (comment)