Skip to content

Build: Linux workspace, contributor setup and CI - #112

Open
Quat3rnion wants to merge 3 commits into
Marvisak:mainfrom
Quat3rnion:contribution-setup
Open

Quat3rnion wants to merge 3 commits into
Marvisak:mainfrom
Quat3rnion:contribution-setup

Conversation

@Quat3rnion

@Quat3rnion Quat3rnion commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What

Makes the workspace build and test on Linux and adds a one-command contributor setup. This combines the portable-test approach from #39 with the setup work prepared here, so #39 can be closed.

  • Gate Windows-only GPU and HLE code; keep translate usable on Linux with its DXIL and D3D12 checks disabled.
  • Use the host-aware path and storage tests from Build: make workspace tests run on Linux #39 instead of skipping them. Gate tests that parse the test binary as a PE image.
  • Add cargo xtask setup and CONTRIBUTING.md; install hooks and write a valid local config on both platforms.
  • Add a Linux CI workflow for workspace tests and the asset policy, alongside the existing Windows CI. The whole-tree formatting change was dropped to avoid conflicts with the other open PRs; the format gate stays tracked in CI: check the formatting with cargo fmt on all PRs #17.

Tested

  • cargo test --workspace --locked: 219 passed, 0 failed, 5 ignored on Linux with the pinned toolchain.
  • cargo xtask policy, cargo build --release --workspace, cargo check --workspace --all-features: pass.
  • Rebased onto main ffe310e.

Title execution stays Windows-only. No game data used.

@DaviTostes

Copy link
Copy Markdown

Tested ee63908 on Arch Linux x86_64, rustc 1.98.1: pass, and it is the first branch that builds and tests on Linux without stacking #39.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

@Sunkiller-qc

Copy link
Copy Markdown

The Linux gating and xtask setup look useful. One practical issue: the "format the workspace once" step puts a lot of pure reformatting (e.g. xma/tables.rs +820/-356) in with the cfg changes across 46 files. That makes the real changes harder to review, and the PR now conflicts with main and with many of the open PRs. Could the cargo fmt --all go in a separate last commit (or PR) that is redone right before merge, with this PR keeping only the gating, setup and CI? The fmt check in CI could then land together with that commit.

Static review, not built or run.

@LazyHatGuy

LazyHatGuy commented Nov 24, 2026 •

Copy link
Copy Markdown

I have verified #112 on Garuda Linux, following the example from @CesarLopesO

Environment

  • Commit: ee63908d50295af044b7950ae5693e49fe88e357
  • OS: Garuda Linux x86_64
  • Kernel: Linux 7.3.5-zen1-1-zen
rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)
rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)

Results

  • cargo fmt --all -- --check -> Exit 0
  • cargo-summary test --workspace --locked -> TEST OK total=168 passed=165 failed=0 ignored=3 in 1.3s
  • cargo xtask policy -> asset policy: 153 files ok
  • cargo xtask policy --staged -> asset policy: 0 files ok
  • cargo xtask setup -> Installs hooks sucessfully

@catminou4

Copy link
Copy Markdown
Contributor

Heads-up for triage: this overlaps heavily with #235 + #523, which are currently the portability candidates being reviewed (I verified #523's head 0012266 compiles and passes the full macOS-buildable suite green). If #235/#523 land first, most of this PR's Linux-workspace changes will be redundant — worth checking the delta against those two before review effort.

@sebastianspicker

Copy link
Copy Markdown

The format pass here moves two // SAFETY: comments away from their unsafe blocks. Once this is rebased onto the current ci.yml (Windows clippy with -D warnings, and the workspace sets undocumented_unsafe_blocks = "warn"), clippy fails on both. At ee63908:

  • crates/victory-gpu/src/list.rs:1450: the comment sits above assert!(, and the unsafe block is now on the next line.
  • crates/victory-gpu/src/watch.rs:363: the same, with assert_eq!(.

I hit exactly these two after formatting 8e79c80 and running cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings (clippy 0.1.98, cross-checked from macOS with cargo-xwin). Moving the block into a let keeps the comment attached, and rustfmt leaves it alone:

// SAFETY: the list is ours.
let uploads = unsafe { &(*list.cast::<List>()).uploads };
assert!(uploads.lock().unwrap().is_empty());
// SAFETY: the bytes just read.
let bytes = unsafe { std::slice::from_raw_parts((view + 100) as *const u8, 13) };
assert_eq!(bytes, b"from the disk");

With those two changes, both clippy runs from ci.yml (plain and --all-features) pass for the Windows target, and cargo fmt --all -- --check passes with rustfmt 1.98.1.

Two smaller things:

  • The format pass also reflows the 16 tables in crates/victory-formats/src/xma/tables.rs to one entry per line (SCALE alone becomes 121 lines). If the 8-per-row layout is worth keeping, #[rustfmt::skip] on each table does it.
  • The Garuda verification above used the distro's rustc 1.100. A non-rustup cargo ignores rust-toolchain.toml, and clippy 0.1.100 reports needless_range_loop in xma.rs and lower.rs that 0.1.98 does not, so results from a distro toolchain don't quite match CI.

AI-assisted.

Gate Windows-only GPU and HLE code, keep the data and shader tools usable, and adapt path-dependent tests to the host platform. No game data is needed.
Add cargo xtask setup, a CONTRIBUTING guide, the Linux target, and make the pre-commit hook executable.

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: apps/victory/src/translate.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants