Skip to content

Fix the Linux build and clippy gates (carries #1017) - #2334

Open
ntgata1-dotcom wants to merge 7 commits into
Marvisak:mainfrom
ntgata1-dotcom:carry-1017-linux-build
Open

ntgata1-dotcom wants to merge 7 commits into
Marvisak:mainfrom
ntgata1-dotcom:carry-1017-linux-build

Conversation

@ntgata1-dotcom

Copy link
Copy Markdown

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 d5de72b on the current main (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-hle still 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:
    • Windows-only items get #[cfg(windows)].
    • Helpers used only by Windows code and tests are allowed unused off Windows.
    • Tests of Windows-only objects run on Windows only.
    • Off Windows, translate skips the validator and host pipeline checks with a note, and translate --cache stops with an error.
  • 1ea4296: one addition. Fix the Linux build and clippy gates #1017 made image_named split title paths at \ and / on every host. On Windows it now keeps Path::file_name, as main does, 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, at dd58dd7:

Result
cargo clippy --workspace --all-targets --locked -- -D warnings, default and --all-features clean
cargo test --workspace --locked, default and --all-features 396 passed, 0 failed, 8 ignored
cargo xtask policy 182 files ok
cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, default and --all-features (cargo-xwin 0.24.1) clean
cargo xwin test --workspace --locked --no-fail-fast --target x86_64-pc-windows-msvc, run under Wine 11.22 (RX 9070 XT, vkd3d-proton) 684 passed, 19 failed, 10 ignored. main: 682 / 19 / 10, with the same 19 failures, all from running under Wine (its HLSL compiler, no git in the prefix and so on). The two extra passes are the new Windows tests.

cargo fmt --all --check lists the same files here as on main.

Not run: Windows itself. CI here is the first native Windows run.

#2008 adds the same #[cfg(windows)] to view_format, and the two merge cleanly in either order.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --locked passes and cargo build -p victory produces a working binary: victory --help runs 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.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The PR merges cleanly again. It adds #[cfg(windows)] gates and off-Windows allow(dead_code) across victory-gpu, victory-hle, victory-shader, the loader and apps/victory so the workspace builds on Linux. On Windows, absolute_title_path and title_file_name in crates/victory-hle/src/runtime.rs keep main's behaviour. Two things need a decision:

  • Scope: VIctory targets Windows, and nothing here keeps a Linux build checked. The last two commits already had to gate code that landed on main after the PR was opened. The PR also adds off-Windows runtime behaviour, which is more than a build fix: xgameui::ask returns None, title_absolute treats Windows-style paths specially, HeapRefusal only logs, and translate --cache stops with an error.
  • Git hook: the last commit changes .githooks/pre-commit from mode 100644 to 100755, which the description does not mention. Please move that to its own PR if you want it.

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

@ntgata1-dotcom

Copy link
Copy Markdown
Author

Thanks. On the three points:

  1. Off-Windows builds: agreed, without a job these gates rot. Rebasing onto 67e8ae1 (82 commits after 940d32f) shows how fast. It needed four new gates for compile errors:

    • texture_desc now calls the Windows-only texture_memory;
    • choose uses the Windows-only IDLE_MS/IDLE_FRAMES;
    • execute leaves this unused;
    • three new shader tests call the validator.

    About 30 items in victory-gpu are also unused off Windows, most of them in the new hold.rs. So this only holds with a Linux job. If you want off-Windows builds, I'll finish the rebase and add a linux job (check, clippy -D warnings, test), here or by extending CI: build and test the host-independent crates on Linux #1241's to the whole workspace. If not, feel free to close this.

  2. Windows CI: it hasn't run because the workflow is waiting for approval (first-time contributor).

  3. The no-op gates: you're right. With the rebase I'll drop the inner #[cfg(windows)] in storage.rs and root.rs, and look at gating the callers of stub_ps/stub_vs so the unreachable!() stubs can go.

AI-assisted (Claude Code).

@ntgata1-dotcom

Copy link
Copy Markdown
Author

Rebased onto 67e8ae1 (no conflicts now) and did point 3, so it's ready either way:

  • 5876087: the gates for what main gained (as listed above).
  • 7828fa7: the inner cfg(windows) in storage.rs and root.rs are gone. translate's host checks are Windows-only, so stub_ps/stub_vs are gone and the off-Windows Host keeps only new.

Linux: clippy -D warnings (default and --all-features) is clean, and cargo test --workspace gives 422 passed, 0 failed. Windows target: clippy -D warnings, both, is clean. Under Wine, the same 27 failures as main. Windows CI still waits for workflow approval.

AI-assisted (Claude Code).

Jitheswar and others added 7 commits November 26, 2026 14:16
`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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants