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

Open
github-bot wants to merge 7 commits from github-bot/gh-2334 into main AGit
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 10:54 UTC · original
ntgata1-dotcom:carry-1017-linux-build → main · +310 −28 · 25 files · 7 commits · open

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: #1017, unchanged. The commits keep Jitheswar as their author. #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. #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 #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

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 10:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2334) `ntgata1-dotcom:carry-1017-linux-build` → `main` · +310 −28 · 25 files · 7 commits · open 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`: #1017, unchanged.** The commits keep Jitheswar as their author. #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.** #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 #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](https://claude.com/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 <[email protected]>
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 <[email protected]>
`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 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:37 +00:00
github-bot force-pushed github-bot/gh-2334 from 7828fa7600 to 9137f3f667 2026-11-26 06:29:44 +00:00 Compare
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:23 UTC · original · edited 2026-11-26 09:18 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 15:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7166775841) · edited 2026-11-26 09:18 UTC <!-- victory-triage v1 head=9137f3f6675ba2800a4f7eca7fca93a4ad2a9e85 verdict=needs-work at=2026-11-26T09:18:00Z --> 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](https://claude.ai/code)_
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 15:56 UTC · original

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 #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** on GitHub · 2026-11-25 15:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7167449166) 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 #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).
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 16:28 UTC · original

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).

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 16:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7168031315) 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).
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 11:03 UTC · original · approved these changes

Tested locally on macOS arm64, merged into main 940d32f69b:

  • 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.

**@⁠catminou4** on GitHub · 2026-11-25 11:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/2334#pullrequestreview-6056392787) · **approved these changes** Tested locally on macOS arm64, merged into main 940d32f69b: - `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.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2334/head:github-bot/gh-2334'
git switch 'github-bot/gh-2334'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2334'
git switch 'github-bot/gh-2334'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2334'
git switch 'github-bot/gh-2334'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2334'
git switch 'main'
git merge --squash 'github-bot/gh-2334'
git switch 'main'
git merge --ff-only 'github-bot/gh-2334'
git switch 'main'
git merge 'github-bot/gh-2334'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2334
No description provided.