Linux: compile, test and run the analysis commands + format all files #1

Open
LazyHatGuy wants to merge 6 commits from upstream-pr/1 into main
LazyHatGuy commented 2026-11-25 02:54:54 +00:00 (Migrated from github.com)
First-time contributor

Imported from Zettrox/ztrx. Originally posted by LazyHatGuy on 2026-11-25T01:44:25Z.


Mirror of https://github.com/fxceless/victory-fork/pull/128

What this does

Makes cargo test --workspace and cargo run -p victory -- config pass on a
Linux host. The tree was already mostly gated behind cfg(windows); this
closes the last leaks, and the Windows build is untouched: every edit is an
attribute or code moved verbatim under a gate.

cargo fmt --all was also ran so the lint job passes

What was leaking

  • victory-loader declared the crash module (VEH handler, windows_sys)
    unconditionally.
  • victory-gpu referenced host::read_into, texture::committed and
    host_resource from code that compiles everywhere. On Linux a memory value
    wait now counts as met, as unmapped memory already does.
  • victory-hle used the Win32 modal dialog, the xmem allocator hook,
    lifecycle's relaunch and files' drive mount from ungated paths. The
    dialog is dismissed and a self-relaunch parks outside Windows.
  • apps/victory's translate command needs the host D3D compiler: like
    run, it is present on Linux and says so.

Tests

Unit tests that lean on a Windows host are gated with cfg(all(test, windows)), following the pattern the tree already uses: the loader and PE
tests parse the host's own test binary as a PE image (an ELF on Linux), and
two kernel tests assume Windows path semantics. Everything else runs on both:
23 test targets, 0 failures.

Hygiene

  • Zero warnings on Linux for cargo check/clippy --workspace --all-targets,
    plain and --all-features. Deps that only the Windows modules use (anyhow,
    tracing, miniz_oxide, opus-pure, victory-core, victory-pipeline,
    victory-shader) moved under the existing cfg(windows) target sections.
  • fetch_update kept with #[allow(deprecated)]: try_update is newer than
    the pinned 1.98 toolchain.
  • Cargo.lock unchanged; --locked passes.

Still Windows-only

Actually running a title: it needs host D3D12 and the Windows loader. Linux
gets the build, the tests, and the file-side commands — config, inspect,
census, lib-exports, shader-info.

This PR was AI assisted

<!-- greyfinch-sync:Zettrox/ztrx:issue:6595211185 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/1). Originally posted by [LazyHatGuy](https://github.com/LazyHatGuy) on 2026-11-25T01:44:25Z. --- Mirror of https://github.com/fxceless/victory-fork/pull/128 ## What this does Makes `cargo test --workspace` and `cargo run -p victory -- config` pass on a Linux host. The tree was already mostly gated behind `cfg(windows)`; this closes the last leaks, and the Windows build is untouched: every edit is an attribute or code moved verbatim under a gate. `cargo fmt --all` was also ran so the lint job passes ## What was leaking - `victory-loader` declared the `crash` module (VEH handler, `windows_sys`) unconditionally. - `victory-gpu` referenced `host::read_into`, `texture::committed` and `host_resource` from code that compiles everywhere. On Linux a memory value wait now counts as met, as unmapped memory already does. - `victory-hle` used the Win32 modal dialog, the `xmem` allocator hook, `lifecycle`'s relaunch and `files`' drive mount from ungated paths. The dialog is dismissed and a self-relaunch parks outside Windows. - `apps/victory`'s `translate` command needs the host D3D compiler: like `run`, it is present on Linux and says so. ## Tests Unit tests that lean on a Windows host are gated with `cfg(all(test, windows))`, following the pattern the tree already uses: the loader and PE tests parse the host's own test binary as a PE image (an ELF on Linux), and two kernel tests assume Windows path semantics. Everything else runs on both: 23 test targets, 0 failures. ## Hygiene - Zero warnings on Linux for `cargo check/clippy --workspace --all-targets`, plain and `--all-features`. Deps that only the Windows modules use (anyhow, tracing, miniz_oxide, opus-pure, victory-core, victory-pipeline, victory-shader) moved under the existing `cfg(windows)` target sections. - `fetch_update` kept with `#[allow(deprecated)]`: `try_update` is newer than the pinned 1.98 toolchain. - `Cargo.lock` unchanged; `--locked` passes. ## Still Windows-only Actually running a title: it needs host D3D12 and the Windows loader. Linux gets the build, the tests, and the file-side commands — `config`, `inspect`, `census`, `lib-exports`, `shader-info`. This PR was AI assisted
Yoshi-233 commented 2026-11-25 02:54:57 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T02:49:45Z.


I tested the PR head 0f44d9fa1af7 from a clean checkout on native Ubuntu 24.04.5 x86-64 with Rust 1.98.1. Both commands exited 0:

cargo test --workspace --locked
cargo run --locked -p victory -- config

I counted 292 passed, 6 ignored across Cargo's test summaries. The CLI printed its cache/data paths with the game directory unset. The shader suite contributed 170 passes and the formats suite 24. No title files or GPU were needed for these two checks.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7151240251 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/1#issuecomment-7151240251). Originally posted by [Yoshi-233](https://github.com/Yoshi-233) on 2026-11-25T02:49:45Z. --- I tested the PR head `0f44d9fa1af7` from a clean checkout on native Ubuntu 24.04.5 x86-64 with Rust 1.98.1. Both commands exited 0: ```sh cargo test --workspace --locked cargo run --locked -p victory -- config ``` I counted **292 passed, 6 ignored** across Cargo's test summaries. The CLI printed its cache/data paths with the game directory unset. The shader suite contributed 170 passes and the formats suite 24. No title files or GPU were needed for these two checks.
futurepro62 commented 2026-11-25 07:06:29 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by futurepro62 on 2026-11-25T06:38:11Z.


Windows full-suite run, to go with Yoshi-233's Ubuntu run above, which could not cover the Windows-only crates. Tested exact head 0f44d9f (on its base 90b529f).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (rust-toolchain.toml), DXC + dxil.dll 1.9.2602.17, debug.
  • cargo test --workspace --locked: 496 passed, 0 failed, 7 ignored (main 90b529f on this machine: 496 passed, 0 failed, 7 ignored).
  • cargo clippy --workspace --all-targets --locked -- -D warnings (the CI lint step): passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (the CI lint step): passed.
  • No new #[test] functions in the diff.

Not tested

  • AMD (ztrx targets NVIDIA), a release build, the game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Zettrox/ztrx:comment:7154998614 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/1#issuecomment-7154998614). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T06:38:11Z. --- Windows full-suite run, to go with Yoshi-233's Ubuntu run above, which could not cover the Windows-only crates. Tested exact head `0f44d9f` (on its base `90b529f`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (`rust-toolchain.toml`), DXC + dxil.dll 1.9.2602.17, debug. - `cargo test --workspace --locked`: **496 passed, 0 failed, 7 ignored** (main `90b529f` on this machine: 496 passed, 0 failed, 7 ignored). - `cargo clippy --workspace --all-targets --locked -- -D warnings` (the CI lint step): passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (the CI lint step): passed. - No new `#[test]` functions in the diff. **Not tested** - AMD (ztrx targets NVIDIA), a release build, the game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
louisdelombaerde commented 2026-11-25 11:10:45 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by louisdelombaerde on 2026-11-25T10:24:40Z.

Review: APPROVED


No description provided.

<!-- greyfinch-sync:Zettrox/ztrx:review:6055793814 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/1#pullrequestreview-6055793814). Originally posted by [louisdelombaerde](https://github.com/louisdelombaerde) on 2026-11-25T10:24:40Z. **Review:** APPROVED --- _No description provided._
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/1:upstream-pr/1'
git switch 'upstream-pr/1'

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/1'
git switch 'upstream-pr/1'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1'
git switch 'upstream-pr/1'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1'
git switch 'main'
git merge --squash 'upstream-pr/1'
git switch 'main'
git merge --ff-only 'upstream-pr/1'
git switch 'main'
git merge 'upstream-pr/1'
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
Zettrox/ztrx!1
No description provided.