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

Open
ntgata1-dotcom wants to merge 7 commits from upstream-pr/2334 into main
ntgata1-dotcom commented 2026-11-25 10:54:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T10:54:12Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6602842843 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2334). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T10:54:12Z. --- 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)
catminou4 commented 2026-11-25 11:05:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T11:03:07Z.

Review: APPROVED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6056392787 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2334#pullrequestreview-6056392787). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T11:03:07Z. **Review:** APPROVED --- 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.
ntgata1-dotcom commented 2026-11-25 16:09:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T15:56:29Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167449166 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7167449166). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T15:56:29Z. --- 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).
Marvisak commented 2026-11-25 16:09:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:23:46Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166775841 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7166775841). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:23:46Z. --- <!-- 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)_
ntgata1-dotcom commented 2026-11-25 17:05:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T16:28:12Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7168031315 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2334#issuecomment-7168031315). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T16:28:12Z. --- 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).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2334:upstream-pr/2334'
git switch 'upstream-pr/2334'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2334'
git switch 'upstream-pr/2334'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2334'
git switch 'upstream-pr/2334'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2334'
git switch 'main'
git merge --squash 'upstream-pr/2334'
git switch 'main'
git merge --ff-only 'upstream-pr/2334'
git switch 'main'
git merge 'upstream-pr/2334'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2332
No description provided.