Repository navigation
Fix the Linux build and clippy gates (carries #1017) - #2334
ntgata1-dotcom wants to merge 7 commits into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64, merged into main 940d32f:
cargo test -p victory-loader --locked— all green, 0 failures. The prepare tests are now correctly#[cfg(windows)]-gated: they parsed the host's own test binary as PE, which can only work on Windows (they were the crate's 3 permanent failures on macOS).cargo check -p victory --lockedpasses andcargo build -p victoryproduces a working binary:victory --helpruns and lists all subcommands on macOS. Before this PR, apps/victory did not compile off Windows at all (hard dependency on the dxc validator and D3D12 host). The validator_stub/host no-op modules are the right shape — checks report as skipped.
This unlocks translate/inspect/census/shader-info development on Linux and macOS. Strong approve.
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision. The PR merges cleanly again. It adds
If the scope is accepted, a smaller PR that only gates Windows-only items and tests, with no new off-Windows runtime paths, plus a Linux CI job, would be easier to judge. CI: not run (the workflow is waiting for approval). Generated by Claude Code |
|
Thanks. On the three points:
AI-assisted (Claude Code). |
dd58dd7 to
7828fa7
Compare
|
Rebased onto
Linux: clippy AI-assisted (Claude Code). |
`main` does not build on non-Windows hosts (CI runs only on windows-latest): `victory-gpu` calls Windows-only items from portable code, and Windows-only callers leave portable helpers unused. - victory-gpu: gate Windows-only items (view_format, samplers, index, forget, view, rtv_record, dsv_record, tagged_record, pc_format, SRGB, DEPTH_FORMATS, PlacedFootprint::bytes, texture_memory, take_indirect, UAV_BARRIER, presented, title_format) with #[cfg(windows)], some #[cfg(any(windows, test))]; the per-memory texture helpers (family, DEPTH, MemoryKey, memory_key, castable), the `switch` module and the loader's `publish` module stay built everywhere (their tests run on every host) and are allowed unused off Windows. The root-signature shim tests and the ID3D12Fence1 test, which drive Windows-only COM objects, are Windows-only. - victory-gpu: silence unused parameters on the non-Windows paths of close/barrier/execute_indirect, matching reset(). - victory-hle: gate `function` (the System32 loader) and the Windows-only modules' imports; keep already-absolute and Windows-style absolute title paths on non-Windows hosts and resolve file names across both separators; gate the drive-over-folder mount test to Windows. - victory-shader: gate the Windows-only imports of the emit tests; `Lowered::rovs` is read only by the GPU tests; the mesh test's program is built for the validator, which only Windows has. - victory-loader/victory-pe: gate tests that read current_exe as PE. - apps/victory: `translate --cache` (the warm-up and pre-build) fills the host's shader cache and pipeline library and is Windows-only; other hosts get an error saying so. Without the Windows DLLs, the validator and host pipelines are skipped with a note. Linux: cargo build, cargo clippy --workspace --all-targets -D warnings (default and --all-features) and cargo test --workspace --all-features (26 suites, 394 passed) pass. Windows target (cargo-xwin): clippy -D warnings, default and --all-features, passes. cargo xtask policy passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the title-path shortcut returned an already-absolute path unchanged, where `main` passed every path through `std::path::absolute` (`GetFullPathNameW`: `/` becomes `\`, `..` is resolved), so a title started as `C:/games/x/../game.exe` would read that raw string back from `GetModuleFileName`. The shortcut now runs only on other hosts, where a Windows-style path must not be joined to the host's current directory; Windows behaves as before. Tests: on Windows `C:/games/x/../game.exe` becomes `C:\games\game.exe`; elsewhere drive-rooted, drive-root and UNC title paths are kept as stored and a relative one is made absolute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…finds `image_named` took the file name from a split at `\` and `/` on every host. Windows keeps `Path::file_name` now, so nothing changes there; the split is for other hosts, whose `Path::file_name` splits only at `/`. A test checks both on each host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New code on main reaches items that are Windows-only off Windows: texture_desc calls texture_memory (now Windows-only too), choose uses IDLE_MS and IDLE_FRAMES (allowed unused off Windows, as choose and its test need them), execute leaves `this` unused, and three new shader tests validate DXIL, which only Windows has. Items only Windows code uses, the new hold module among them, are allowed unused off Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ithout stubs The inner cfg(windows) block of a test that is already Windows-only, and a cfg(windows) import in a module that already is, go. translate's host checks (the Checks field and its use) are Windows-only, so the stand-in Host off Windows keeps only `new`, which fails, and the unreachable stub shaders are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The re-export of descriptor::host's fallback_samplers and the new page-table test are Windows-only, as what they reach is. The audio allocator's refusal is reported through xmem on Windows and logged elsewhere. The password dialog's edit-style test and its helper are Windows-only. A shader test's `lowered` is only written by the Windows validator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7828fa7 to
9137f3f
Compare
This carries #1017. Its author closed it today and its fork has since been deleted, so it can't be reopened. Its last triage, at
d5de72bon the currentmain(940d32f), was "merge candidate". Of the other open Linux-build PRs, #112 and #523 need a rebase, and #2008 fixes only the first error: with it alone,victory-hlestill doesn't compile on Linux (7 errors, 8 with its tests).What
5189576,d5de72b: Fix the Linux build and clippy gates #1017, unchanged. The commits keep Jitheswar as their author. Fix the Linux build and clippy gates #1017's description lists the changes. In short:#[cfg(windows)].translateskips the validator and host pipeline checks with a note, andtranslate --cachestops with an error.1ea4296: one addition. Fix the Linux build and clippy gates #1017 madeimage_namedsplit title paths at\and/on every host. On Windows it now keepsPath::file_name, asmaindoes, so no Windows code path changes; the split is for other hosts only. A new test checks the name on both.dd58dd7: rustfmt's layout for Fix the Linux build and clippy gates #1017's new title-path test. No other formatting.Checks
Arch Linux, Rust 1.98.1 from
rust-toolchain.toml, atdd58dd7:cargo clippy --workspace --all-targets --locked -- -D warnings, default and--all-featurescargo test --workspace --locked, default and--all-featurescargo xtask policycargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, default and--all-features(cargo-xwin 0.24.1)cargo xwin test --workspace --locked --no-fail-fast --target x86_64-pc-windows-msvc, run under Wine 11.22 (RX 9070 XT, vkd3d-proton)main: 682 / 19 / 10, with the same 19 failures, all from running under Wine (its HLSL compiler, nogitin the prefix and so on). The two extra passes are the new Windows tests.cargo fmt --all --checklists the same files here as onmain.Not run: Windows itself. CI here is the first native Windows run.
#2008 adds the same
#[cfg(windows)]toview_format, and the two merge cleanly in either order.AI-assisted (Claude Code).
🤖 Generated with Claude Code