Skip to content

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

Open
LazyHatGuy wants to merge 6 commits into
fxceless:mainfrom
LazyHatGuy:linux
Open

LazyHatGuy wants to merge 6 commits into
fxceless:mainfrom
LazyHatGuy:linux

Conversation

@LazyHatGuy

@LazyHatGuy LazyHatGuy commented Nov 24, 2026 •

Copy link
Copy Markdown

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 <noreply@qwen.ai>

🤖 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 <noreply@qwen.ai>

🤖 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 <noreply@qwen.ai>

🤖 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 <noreply@qwen.ai>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
@ericomeehan

Copy link
Copy Markdown

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:

Written with an AI assistant (Claude).

@ErRusso ErRusso left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@LazyHatGuy LazyHatGuy changed the title Linux: compile, test and run the analysis commands Linux: compile, test and run the analysis commands + format all files Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants