Build: compile and test the workspace on Linux again #523

Open
github-bot wants to merge 1 commit from github-bot/gh-523 into main AGit
Owner

@⁠spidercraft on GitHub · 2026-11-24 04:27 UTC · original
spidercraft:linux-build → main · +103 −13 · 9 files · 1 commits · open

What

main no longer builds on Linux (E0425 host_resource in victory-gpu, then Windows-only modules reached from victory-hle). This gates only those uses, so the workspace builds and its tests run on Linux again:

  • view_format and the D3D12 allocator hookup are Windows-only, like what they call.
  • XLaunchNewGame ends the title only on Windows; the text entry dialog answers "dismissed" elsewhere.
  • translate --validate / --pipelines refuse to start off Windows (no host validator or D3D12 there); translation itself runs.
  • Tests that parse the test binary as a PE image, or use Windows title paths, are ignored off Windows, each with its reason.

No reformatting, no behaviour change on Windows. #112 covers the same ground plus setup and CI, but it conflicts with main today and reformats the workspace; this is the minimal fix, and the base of the native Linux runtime PRs that follow.

Tested

  • Linux (CachyOS, rustc 1.98.1): cargo test --workspace passes, 162 passed, 13 ignored.
  • cargo check --workspace --all-targets --target x86_64-pc-windows-msvc: same diagnostics as before (none).
  • cargo xtask policy ok. No game data used.

🤖 Generated with Claude Code

**@⁠spidercraft** on GitHub · 2026-11-24 04:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/523) `spidercraft:linux-build` → `main` · +103 −13 · 9 files · 1 commits · open ## What `main` no longer builds on Linux (E0425 `host_resource` in `victory-gpu`, then Windows-only modules reached from `victory-hle`). This gates only those uses, so the workspace builds and its tests run on Linux again: - `view_format` and the D3D12 allocator hookup are Windows-only, like what they call. - `XLaunchNewGame` ends the title only on Windows; the text entry dialog answers "dismissed" elsewhere. - `translate --validate` / `--pipelines` refuse to start off Windows (no host validator or D3D12 there); translation itself runs. - Tests that parse the test binary as a PE image, or use Windows title paths, are ignored off Windows, each with its reason. No reformatting, no behaviour change on Windows. #112 covers the same ground plus setup and CI, but it conflicts with `main` today and reformats the workspace; this is the minimal fix, and the base of the native Linux runtime PRs that follow. ## Tested - Linux (CachyOS, rustc 1.98.1): `cargo test --workspace` passes, 162 passed, 13 ignored. - `cargo check --workspace --all-targets --target x86_64-pc-windows-msvc`: same diagnostics as before (none). - `cargo xtask policy` ok. No game data used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since the world bring-up, main no longer builds on Linux: victory-gpu
names host_resource outside its cfg(windows), and victory-hle reaches
Windows-only modules (xmem, files, lifecycle, the text entry dialog).
This gates those uses only, as the smallest base for a native Linux
runtime:

- view_format and the D3D12 allocator hookup are Windows-only, like
  what they call.
- XLaunchNewGame ends the title only on Windows; the text entry dialog
  answers "dismissed" elsewhere.
- translate --validate / --pipelines refuse to start off Windows (no
  host DXIL validator or D3D12 there); translation itself runs.
- Tests that parse the test binary as a PE image, or use Windows title
  paths, are ignored off Windows with the reason.

Tested: Linux (CachyOS, rustc 1.98.1): cargo test --workspace passes
(162 passed, 13 ignored). cargo check --target x86_64-pc-windows-msvc
--all-targets gives the same diagnostics as before (none).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:07:04 +00:00
Author
Owner

@⁠spidercraft on GitHub · 2026-11-24 04:35 UTC · original

Note: #235 makes the same minimal Linux gates and was opened earlier; the two conflict. If #235 lands first I'll rebase #524 and #526 onto it and close this one.

**@⁠spidercraft** on GitHub · 2026-11-24 04:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7122158644) Note: #235 makes the same minimal Linux gates and was opened earlier; the two conflict. If #235 lands first I'll rebase #524 and #526 onto it and close this one.
Author
Owner

@⁠KoLolX3 on GitHub · 2026-11-24 05:34 UTC · original

Check on Linux, not Windows: pass. Head 001226617 merged onto main d2a4bae1f (clean merge).

  • Native tests of the seven crates that build on Linux (core, formats, game, loader, pe, pipeline, shader): PR 92 passed, 0 failed, main 92 passed, 7 failed. The 7 tests that fail on main no longer fail.
  • Whole workspace, native Linux (what this PR is for): cargo check --workspace --all-targets ok and cargo test --workspace ok: 162 passed, 0 failed, 13 ignored, including victory-gpu (23) and victory-hle (43). On main the same check fails to build (3 errors). The 7 tests that fail on main in victory-loader and victory-pe are now #[ignore]d on this platform (3 + 4), not repaired.
  • Windows cross type-check of the whole workspace (cargo xwin check --workspace --target x86_64-pc-windows-msvc, covers victory-gpu, victory-hle and the app): PR ok, main ok.
  • Tests this PR adds: 0 (so the native result only shows the existing tests still pass; the change itself is not covered by a test here).
  • rustfmt: unformatted hunks, PR 168, main 168.
  • Failing on main here as well (not this PR): 7 tests in victory-loader and victory-pe that parse their own test binary as a PE image, which is an ELF file on Linux.
  • Not run: victory-gpu / victory-hle tests and the game itself.

On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.

**@⁠KoLolX3** on GitHub · 2026-11-24 05:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7123077673) Check on Linux, not Windows: **pass**. Head `001226617` merged onto `main` `d2a4bae1f` (clean merge). - Native tests of the seven crates that build on Linux (`core`, `formats`, `game`, `loader`, `pe`, `pipeline`, `shader`): PR `92 passed, 0 failed`, `main` `92 passed, 7 failed`. The 7 tests that fail on `main` no longer fail. - **Whole workspace, native Linux** (what this PR is for): `cargo check --workspace --all-targets` ok and `cargo test --workspace` ok: **162 passed, 0 failed, 13 ignored**, including `victory-gpu` (23) and `victory-hle` (43). On `main` the same check fails to build (3 errors). The 7 tests that fail on `main` in `victory-loader` and `victory-pe` are now `#[ignore]`d on this platform (3 + 4), not repaired. - Windows cross type-check of the whole workspace (`cargo xwin check --workspace --target x86_64-pc-windows-msvc`, covers `victory-gpu`, `victory-hle` and the app): PR ok, `main` ok. - Tests this PR adds: 0 (so the native result only shows the existing tests still pass; the change itself is not covered by a test here). - rustfmt: unformatted hunks, PR 168, `main` 168. - Failing on `main` here as well (not this PR): 7 tests in `victory-loader` and `victory-pe` that parse their own test binary as a PE image, which is an ELF file on Linux. - Not run: `victory-gpu` / `victory-hle` tests and the game itself. On: AMD Ryzen 7 5700, 62 GB RAM, Artix Linux 7.3.4-artix1-2, rustc 1.98.1 (the repo's pinned toolchain), cargo-xwin 0.24.1. No game data. Automated check only: the code itself was not reviewed.
Author
Owner

@⁠ThomasHFWright on GitHub · 2026-11-24 12:46 UTC · original

Verified this PR's patch from 0012266175278c7b220c00f09e2a7bef08aa63df applied cleanly to current main ffe310eb2098e52169f4c44db5ffdabf43a72622 in a separate checkout, using the pinned Rust 1.98.1 on Linux x86_64. Both refs were unchanged when rechecked before posting.

  • Baseline cargo check --workspace --all-targets --locked --offline: fails with E0425, host_resource not found in victory-gpu.
  • Same check with this patch: passes (warnings remain).
  • cargo test --workspace --locked --offline --no-fail-fast: 215 passed, 0 failed, 15 ignored. Ten ignores are the Windows-specific cases gated by this PR; the other five are reference-data tests/benchmarks. Ignored tests are not counted as passes.
  • cargo check --workspace --all-targets --all-features --locked --offline --target x86_64-pc-windows-msvc: passes without warnings, using clang-cl/lld-link and an MSVC SDK.
  • Asset policy (cargo run --locked --offline --quiet -p xtask -- policy): passes.
  • Native CLI build passes. Against an empty input directory, plain translate exits 0; translate --validate and translate --pipelines each exit 1 with needs Windows (the host DXIL validator and D3D12).

All checks ran with networking disabled. No game data was used. The Windows cross-check initially hit a read-only sandbox error because BLAKE3's compiler emits a temporary assembly file beside its source; it passed after giving that dependency a disposable writable copy, without changing the PR.

Not checked: native Windows execution, native Linux gameplay, or shader translation with real input. This validates Linux build/test portability and the CLI guards, not runtime support.

AI-assisted testing with Codex.

**@⁠ThomasHFWright** on GitHub · 2026-11-24 12:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7131909597) Verified this PR's patch from `0012266175278c7b220c00f09e2a7bef08aa63df` applied cleanly to current `main` `ffe310eb2098e52169f4c44db5ffdabf43a72622` in a separate checkout, using the pinned Rust 1.98.1 on Linux x86_64. Both refs were unchanged when rechecked before posting. - Baseline `cargo check --workspace --all-targets --locked --offline`: fails with E0425, `host_resource` not found in `victory-gpu`. - Same check with this patch: passes (warnings remain). - `cargo test --workspace --locked --offline --no-fail-fast`: **215 passed, 0 failed, 15 ignored**. Ten ignores are the Windows-specific cases gated by this PR; the other five are reference-data tests/benchmarks. Ignored tests are not counted as passes. - `cargo check --workspace --all-targets --all-features --locked --offline --target x86_64-pc-windows-msvc`: passes without warnings, using clang-cl/lld-link and an MSVC SDK. - Asset policy (`cargo run --locked --offline --quiet -p xtask -- policy`): passes. - Native CLI build passes. Against an empty input directory, plain `translate` exits 0; `translate --validate` and `translate --pipelines` each exit 1 with `needs Windows (the host DXIL validator and D3D12)`. All checks ran with networking disabled. No game data was used. The Windows cross-check initially hit a read-only sandbox error because BLAKE3's compiler emits a temporary assembly file beside its source; it passed after giving that dependency a disposable writable copy, without changing the PR. Not checked: native Windows execution, native Linux gameplay, or shader translation with real input. This validates Linux build/test portability and the CLI guards, not runtime support. AI-assisted testing with Codex.
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-24 16:47 UTC · original

Tested on Linux (Arch, pinned 1.98.1), your head 0012266 merged on ffe310e: cargo build --workspace is clean and cargo test --workspace --locked passes, so it does fix the E0425 (host_resource at resource.rs:284).

But host cargo clippy --workspace --all-targets --locked -- -D warnings fails on the gated imports, now unused:

  • crates/victory-shader/src/emit/mod.rs:407 super::bitcode::Attr
  • .../emit/mod.rs:422 super::shader::Shader
  • crates/victory-gpu/src/fence.rs:138 super::*, :139 crate::object::slot
  • crates/victory-gpu/src/pipeline.rs:21 OnceLock

#1017 passes that same clippy plus the tests and the Windows-target clippy (both feature sets) as of today, so this one looks superseded; worth comparing before either merges.

Not tested: Windows, the game.

**@⁠pablogonz12** on GitHub · 2026-11-24 16:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7138217124) Tested on Linux (Arch, pinned 1.98.1), your head 0012266 merged on ffe310e: `cargo build --workspace` is clean and `cargo test --workspace --locked` passes, so it does fix the E0425 (`host_resource` at `resource.rs:284`). But host `cargo clippy --workspace --all-targets --locked -- -D warnings` fails on the gated imports, now unused: - `crates/victory-shader/src/emit/mod.rs:407` `super::bitcode::Attr` - `.../emit/mod.rs:422` `super::shader::Shader` - `crates/victory-gpu/src/fence.rs:138` `super::*`, `:139` `crate::object::slot` - `crates/victory-gpu/src/pipeline.rs:21` `OnceLock` #1017 passes that same clippy plus the tests and the Windows-target clippy (both feature sets) as of today, so this one looks superseded; worth comparing before either merges. Not tested: Windows, the game.
Author
Owner

@⁠Impre-visible on GitHub · 2026-11-24 19:19 UTC · original

One more Wine-specific point, measured tonight on Linux (GE-Proton11-6 Wine, vkd3d-proton from Proton Experimental, GTX 1660):

Under Wine the indirect argument clamp never compiles, so every indirect execution is dropped. crates/victory-gpu/src/indirect.rs builds its clamp shader with D3DCompile. Wine's built-in d3dcompiler_47 (vkd3d-shader's HLSL compiler) rejects it:

WARN victory_gpu::indirect: argument clamp: clamp:19:27: E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'.
WARN victory_gpu::indirect: no argument clamp: indirect execution dropped

and the frame-rate lines then report dropped N/frame without a host pipeline: indirect kind K: not bounded (no clamp, or arguments not 4-byte aligned).

not bounded report lines in one run to about frame 1930 clamp compile errors
Wine's built-in d3dcompiler_47 68 1
Microsoft's d3dcompiler_47.dll in the prefix (winetricks d3dcompiler_47) 0 0

With the native compiler the indirect draws run: the world frame time goes from about 1.3-4.6 s to 7-14 s here, and I get 16 warnings a draw or dispatch dropped: no dynamic slots for its tables. The final image is still dark in both cases.

So for Linux users today: install the native d3dcompiler_47 in the prefix. A fix on the VIctory side could be to ship the clamp as precompiled bytecode, or to write it without RWByteAddressBuffer.Load/Load3/Store2/Store3; I have not tested either.

**@⁠Impre-visible** on GitHub · 2026-11-24 19:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7141924282) One more Wine-specific point, measured tonight on Linux (GE-Proton11-6 Wine, vkd3d-proton from Proton Experimental, GTX 1660): **Under Wine the indirect argument clamp never compiles, so every indirect execution is dropped.** `crates/victory-gpu/src/indirect.rs` builds its clamp shader with `D3DCompile`. Wine's built-in `d3dcompiler_47` (vkd3d-shader's HLSL compiler) rejects it: ``` WARN victory_gpu::indirect: argument clamp: clamp:19:27: E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'. WARN victory_gpu::indirect: no argument clamp: indirect execution dropped ``` and the frame-rate lines then report `dropped N/frame without a host pipeline: indirect kind K: not bounded (no clamp, or arguments not 4-byte aligned)`. | | `not bounded` report lines in one run to about frame 1930 | clamp compile errors | |---|---|---| | Wine's built-in d3dcompiler_47 | 68 | 1 | | Microsoft's d3dcompiler_47.dll in the prefix (`winetricks d3dcompiler_47`) | 0 | 0 | With the native compiler the indirect draws run: the world frame time goes from about 1.3-4.6 s to 7-14 s here, and I get 16 warnings `a draw or dispatch dropped: no dynamic slots for its tables`. The final image is still dark in both cases. So for Linux users today: install the native `d3dcompiler_47` in the prefix. A fix on the VIctory side could be to ship the clamp as precompiled bytecode, or to write it without `RWByteAddressBuffer.Load/Load3/Store2/Store3`; I have not tested either.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:23 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 00:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7148466504) <!-- victory-triage v1 head=0012266175278c7b220c00f09e2a7bef08aa63df verdict=needs-rebase at=2026-11-25T00:13:20Z --> 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](https://claude.ai/code)_
Author
Owner

@⁠tarcisioads on GitHub · 2026-11-25 01:27 UTC · original

Tested this on macOS (Darwin arm64, cargo 1.100.0) cherry-picked onto current main (42363ab):

  • The xgame.rs change is already present on main, and apps/victory/src/translate.rs had a small conflict at the end of the file with the new tests module.
  • On current main, two newer paths in apps/victory also need #[cfg(windows)] gating so cargo test --workspace builds off Windows:
    • apps/victory/src/translate.rs: warm() (calls victory_gpu::shader_cache, which is #[cfg(windows)])
    • apps/victory/src/prebuild.rs: prebuild::run() and its victory_gpu::pipeline::{Prebuild, ...} imports (also #[cfg(windows)])
  • With those gated, cargo test --workspace passes on macOS (400 passed, 0 failed, 18 ignored) and cargo xtask policy passes (182 files ok).
**@⁠tarcisioads** on GitHub · 2026-11-25 01:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7149560730) Tested this on **macOS (`Darwin arm64`, `cargo 1.100.0`)** cherry-picked onto current `main` (`42363ab`): - The `xgame.rs` change is already present on `main`, and `apps/victory/src/translate.rs` had a small conflict at the end of the file with the new `tests` module. - On current `main`, two newer paths in `apps/victory` also need `#[cfg(windows)]` gating so `cargo test --workspace` builds off Windows: - `apps/victory/src/translate.rs`: `warm()` (calls `victory_gpu::shader_cache`, which is `#[cfg(windows)]`) - `apps/victory/src/prebuild.rs`: `prebuild::run()` and its `victory_gpu::pipeline::{Prebuild, ...}` imports (also `#[cfg(windows)]`) - With those gated, `cargo test --workspace` passes on macOS (**400 passed, 0 failed, 18 ignored**) and `cargo xtask policy` passes (`182 files ok`).
Author
Owner

@⁠tarcisioads on GitHub · 2026-11-25 01:37 UTC · original

I pushed a rebased branch with those two apps/victory #[cfg(windows)] fixes on top of main (42363ab) in case it's helpful: https://github.com/tarcisioads/VIctory/tree/test/macos-pr523 (commits 8461553 and f7d7d75).

**@⁠tarcisioads** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7149759820) I pushed a rebased branch with those two `apps/victory` `#[cfg(windows)]` fixes on top of `main` (`42363ab`) in case it's helpful: https://github.com/tarcisioads/VIctory/tree/test/macos-pr523 (commits `8461553` and `f7d7d75`).
Author
Owner

@⁠astrosteveo on GitHub · 2026-11-25 02:25 UTC · original

I rebased this onto 940d32f, keeping your commit, in https://github.com/astrosteveo/VIctory/pull/1. On top of it: the two newer breaks tarcisioads found (warm, prebuild), one cfg_attr(not(windows), allow(...)) line per affected crate so clippy passes with -D warnings, an executable pre-commit hook with a test, and a Linux CI job as a separate commit. Linux: 401 tests passed, 0 failed, 18 ignored. CI passes on Windows and Linux. Take whatever is useful; I'm not opening a competing PR. Done with AI assistance (Claude).

**@⁠astrosteveo** on GitHub · 2026-11-25 02:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/523#issuecomment-7150692522) I rebased this onto `940d32f`, keeping your commit, in https://github.com/astrosteveo/VIctory/pull/1. On top of it: the two newer breaks tarcisioads found (`warm`, `prebuild`), one `cfg_attr(not(windows), allow(...))` line per affected crate so clippy passes with `-D warnings`, an executable pre-commit hook with a test, and a Linux CI job as a separate commit. Linux: 401 tests passed, 0 failed, 18 ignored. CI passes on Windows and Linux. Take whatever is useful; I'm not opening a competing PR. Done with AI assistance (Claude).
This pull request has changes conflicting with the target branch.
  • apps/victory/src/translate.rs
  • crates/victory-hle/src/modules/xgame.rs
  • crates/victory-hle/src/modules/xgameui.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/523/head:github-bot/gh-523'
git switch 'github-bot/gh-523'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-523'
git switch 'github-bot/gh-523'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-523'
git switch 'github-bot/gh-523'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-523'
git switch 'main'
git merge --squash 'github-bot/gh-523'
git switch 'main'
git merge --ff-only 'github-bot/gh-523'
git switch 'main'
git merge 'github-bot/gh-523'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!523
No description provided.