Skip to content

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

Open
spidercraft wants to merge 1 commit into
Marvisak:mainfrom
spidercraft:linux-build
Open

spidercraft wants to merge 1 commit into
Marvisak:mainfrom
spidercraft:linux-build

Conversation

@spidercraft

Copy link
Copy Markdown

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

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 <noreply@anthropic.com>
@spidercraft

Copy link
Copy Markdown
Author

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.

@upipibi upipibi mentioned this pull request Nov 24, 2026
@KoLolX3

KoLolX3 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified on macOS 26 arm64, rustc 1.98.1, head 0012266, full macOS-buildable suite with --locked --no-fail-fast:

  • victory-core 8, victory-formats 20 (+3 ignored), victory-loader 3 (+4 ignored), victory-pe 3 (+3 ignored), victory-shader 56, victory-pipeline 4, victory-game 2, xtask 4 — 0 failed
  • The ignored tests are exactly the PE-own-binary ones this PR gates off non-Windows (they fail on main).

cargo check --workspace --all-targets is also clean on this head (modulo one pre-existing dead-code warning in victory-shader's lib test, fixed in #685).

I can't verify the Linux CI claims themselves (no Linux/docker here), but the portability fixes compile and test green on macOS too. Approving.

@ThomasHFWright

Copy link
Copy Markdown

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.

@pablogonz12

Copy link
Copy Markdown

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.

@Impre-visible

Copy link
Copy Markdown

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.

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

zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 25, 2026
Keep both the fork's typed-float NaN test and the upstream branch-join regression. Gate the Windows-only view_format helper so the GPU crate can be tested off Windows; the same one-line gate is part of Marvisak#523 and Marvisak#1241.

Validated Linux formats, GPU, PE, and shader unit tests and Windows MSVC workspace test compilation (with a disposable Linux builder workaround).
@tarcisioads

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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).

@astrosteveo

Copy link
Copy Markdown

I rebased this onto 940d32f, keeping your commit, in astrosteveo#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).

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