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

Closed
github-bot wants to merge 6 commits from github-bot/gh-128 into main AGit
Owner

@⁠LazyHatGuy on GitHub · 2026-11-24 21:42 UTC · original
LazyHatGuy:linux → main · +5372 −1611 · 72 files · 6 commits · closed without merging

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

**@⁠LazyHatGuy** on GitHub · 2026-11-24 21:42 UTC · [original](https://github.com/fxceless/victory-fork/pull/128) `LazyHatGuy:linux` → `main` · +5372 −1611 · 72 files · 6 commits · closed without merging ## 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
The GPU and loader modules declared crash, texture and host reads
unconditionally, and hle's UI dialog, allocator hook and relaunch call
Windows items the modules no longer export here. Gate each; on Linux a
value wait is met as unmapped memory is, the host dialog and title
relaunch are dismissed, and the translate command says what it needs.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
The loader and PE tests parse the host's own test binary as PE, and two
kernel tests read image paths a Windows host keeps as given: on Linux
the binary is an ELF and a `C:\...` path is one relative name. Gate
those tests to Windows; the rest run on both.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
On a Linux host the Windows-only users of some items are compiled out,
so their imports and host-side bookkeeping stand unused: move the
dependencies that only the Windows modules use (anyhow, tracing,
miniz_oxide, opus-pure, victory-core, victory-pipeline, victory-shader)
under the existing cfg(windows) target sections, gate the remaining
Windows-only imports and one helper, allow the dead host-side bookkeeping
in the GPU files where it has no Linux caller, and keep the deprecated
fetch_update allowed until the pinned toolchain can take try_update.
No behaviour changes anywhere; the Windows build is untouched.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
`queue::presented` is only read from the capture and host code, all of
it Windows-side, so the diagnostics feature alone left it dead.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:38 +00:00
Author
Owner

@⁠ericomeehan on GitHub · 2026-11-24 22:28 UTC · original

The CI changes look careful: actions pinned by commit SHA, permissions: contents: read kept, no secrets, and the concurrency group fixed for pull requests. Three things to check:

  • cargo fmt --all -- --check is a new gate. The workspace may not be rustfmt-clean at main (an AGENTS.md draft upstream, Marvisak/VIctory#1707, says a full cargo fmt is avoided because of that, and this fork has added a lot of code since). If main doesn't pass it today, every open PR goes red once this lands. Worth running it on main first, or landing the formatting separately.
  • actions-rust-lang/setup-rust-toolchain in place of rustup toolchain install plus Swatinem/rust-cache: it reads rust-toolchain.toml and caches by default, so the pinned 1.98.1 toolchain should still apply. Worth confirming in the first run's log that it isn't picking up stable.
  • #64 also edits ci.yml (a Linux cross-compile job), so the two will conflict; #37 and the Wine fixes (#20, #28, #127) overlap with the Linux goal too.

Written with an AI assistant (Claude).

**@⁠ericomeehan** on GitHub · 2026-11-24 22:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/128#issuecomment-7146282723) The CI changes look careful: actions pinned by commit SHA, `permissions: contents: read` kept, no secrets, and the concurrency group fixed for pull requests. Three things to check: - **`cargo fmt --all -- --check` is a new gate.** The workspace may not be rustfmt-clean at `main` (an `AGENTS.md` draft upstream, Marvisak/VIctory#1707, says a full `cargo fmt` is avoided because of that, and this fork has added a lot of code since). If `main` doesn't pass it today, every open PR goes red once this lands. Worth running it on `main` first, or landing the formatting separately. - **`actions-rust-lang/setup-rust-toolchain` in place of `rustup toolchain install` plus `Swatinem/rust-cache`:** it reads `rust-toolchain.toml` and caches by default, so the pinned 1.98.1 toolchain should still apply. Worth confirming in the first run's log that it isn't picking up stable. - **#64 also edits `ci.yml`** (a Linux cross-compile job), so the two will conflict; #37 and the Wine fixes (#20, #28, #127) overlap with the Linux goal too. Written with an AI assistant (Claude).
Author
Owner

@⁠Yoshi-233 on GitHub · 2026-11-25 02:49 UTC · original

Independent Linux compilation check at your PR head 072b1e3bfa45, with Rust 1.98.1 on Ubuntu 24.04.5 x86-64: cargo check --locked --workspace --all-targets exited 0, including the CLI, GPU, HLE, pipeline and xtask crates. The all-targets check compiled the Linux test targets too. This result is for compilation; it does not exercise the Windows runtime paths.

**@⁠Yoshi-233** on GitHub · 2026-11-25 02:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/128#issuecomment-7151229693) Independent Linux compilation check at your PR head `072b1e3bfa45`, with Rust 1.98.1 on Ubuntu 24.04.5 x86-64: `cargo check --locked --workspace --all-targets` exited 0, including the CLI, GPU, HLE, pipeline and xtask crates. The all-targets check compiled the Linux test targets too. This result is for compilation; it does not exercise the Windows runtime paths.
github-bot closed this pull request 2026-11-26 14:47:39 +00:00
Author
Owner

@⁠ErRusso on GitHub · 2026-11-24 23:45 UTC · original · requested changes

Reviewed at 7c936ab against 2119b0e.

Linux build/test gating is sound: cargo test --workspace --locked passes on this Linux host (all targets green; 170 in victory-shader, 48 in victory-hle, etc.), and the Windows-only paths are gated without changing the Windows build.

Blocking: the new CI fmt step fails on this branch. cargo fmt --all -- --check exits 1 with a large diff (12k lines of formatting output, starting at apps/victory/src/main.rs). Since the PR adds cargo fmt --all -- --check to CI, either run cargo fmt --all and commit the result, or drop the fmt step. As written, the new lint job cannot pass.

Also check the ubuntu-latest matrix job: the workspace tests pass here, but the job needs the pinned toolchain and any system deps; it is otherwise reasonable.

**@⁠ErRusso** on GitHub · 2026-11-24 23:45 UTC · [original](https://github.com/fxceless/victory-fork/pull/128#pullrequestreview-6049254117) · **requested changes** Reviewed at `7c936ab` against `2119b0e`. Linux build/test gating is sound: `cargo test --workspace --locked` passes on this Linux host (all targets green; 170 in victory-shader, 48 in victory-hle, etc.), and the Windows-only paths are gated without changing the Windows build. Blocking: the new CI `fmt` step fails on this branch. `cargo fmt --all -- --check` exits 1 with a large diff (12k lines of formatting output, starting at `apps/victory/src/main.rs`). Since the PR adds `cargo fmt --all -- --check` to CI, either run `cargo fmt --all` and commit the result, or drop the fmt step. As written, the new lint job cannot pass. Also check the `ubuntu-latest` matrix job: the workspace tests pass here, but the job needs the pinned toolchain and any system deps; it is otherwise reasonable.
Author
Owner

@⁠ErRusso on GitHub · 2026-11-25 11:15 UTC · original · approved these changes

Reviewed at 072b1e3. The formatting blocker is resolved:

  • cargo fmt --all -- --check now exits 0 with no diff on this branch. The only commit after my review is Format all files, so the gating and test results from the previous review still hold.
  • @⁠Yoshi-233's independent cargo check --locked --workspace --all-targets at this same head passes.

The PR is currently CONFLICTING with main; please rebase before merging. With that, the Linux gating and the CI changes are good to go.

**@⁠ErRusso** on GitHub · 2026-11-25 11:15 UTC · [original](https://github.com/fxceless/victory-fork/pull/128#pullrequestreview-6056597748) · **approved these changes** Reviewed at `072b1e3`. The formatting blocker is resolved: - `cargo fmt --all -- --check` now exits 0 with no diff on this branch. The only commit after my review is `Format all files`, so the gating and test results from the previous review still hold. - @⁠Yoshi-233's independent `cargo check --locked --workspace --all-targets` at this same head passes. The PR is currently `CONFLICTING` with `main`; please rebase before merging. With that, the Linux gating and the CI changes are good to go.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.