Skip to content

Linux build: main builds, lints and tests off Windows again (carries #2334, fixes #90) - #2890

Open
arogan178 wants to merge 8 commits into
Marvisak:mainfrom
arogan178:linux-build-carry
Open

arogan178 wants to merge 8 commits into
Marvisak:mainfrom
arogan178:linux-build-carry

Conversation

@arogan178

@arogan178 arogan178 commented Nov 25, 2026 •

Copy link
Copy Markdown

main does not build on Linux (#90): cargo check --workspace --all-targets at 842b0cb stops with 21 errors in victory-gpu and victory-shader. That blocks contributors on Linux from running the tests at all.

This carries #2334, which conflicts with main, rebased onto 842b0cb. Its commits keep their authors. #2334 in turn carries #1017; its description lists what the gates do.

What is new here

  • Rebase conflict in xgameui.rs. main added a password parameter to ask. The off-Windows ask takes it too and still cancels.
  • 0721c05: gates for code main gained after Fix the Linux build and clippy gates (carries #1017) #2334.
    • descriptor::fallback_samplers is re-exported on Windows only, beside its host module.
    • a_released_view_heap_drops_its_page_table runs on Windows only. It reads the host heap and memory.
    • Off Windows, the audio heap logs a host-allocator refusal with tracing::warn!, because xmem is Windows-only.
    • password_scope_masks_the_edit_control checks the edit-control style on Windows only. The scope-to-password check still runs everywhere.
    • In the wave64 validator test, lowered is mutable on Windows only, so unused_mut is allowed off Windows.
  • 5333d11: a Linux CI job, so main stays building off Windows. Since Fix the Linux build and clippy gates (carries #1017) #2334 was opened, main broke the Linux build twice more. The job runs on ubuntu-latest with the same clippy gates and tests as the Windows job. The job itself is from Build and test on Linux; a CI job keeps it so; VICTORY_LOG_FILE #2670.

No behaviour changes on Windows.

Proof

On CachyOS Linux, Rust 1.98.1:

  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean. The same command with --all-features is also clean.
  • cargo test --workspace --locked: 458 passed, 0 failed.
  • CI on this PR: the new linux job and the Windows check job both pass.
  • main at 842b0cb: cargo check --workspace --all-targets fails with 21 errors.
  • Windows target, cross-checked from Linux (--target x86_64-pc-windows-msvc, with clang-cl for blake3's C files): both CI clippy gates are clean. CI here runs the Windows tests.
  • cargo xtask policy: 191 files ok.

Jitheswar and others added 8 commits November 26, 2026 00:04
`main` does not build on non-Windows hosts (CI runs only on
windows-latest): `victory-gpu` calls Windows-only items from portable
code, and Windows-only callers leave portable helpers unused.

- victory-gpu: gate Windows-only items (view_format, samplers, index,
  forget, view, rtv_record, dsv_record, tagged_record, pc_format,
  SRGB, DEPTH_FORMATS, PlacedFootprint::bytes, texture_memory,
  take_indirect, UAV_BARRIER, presented, title_format) with
  #[cfg(windows)], some #[cfg(any(windows, test))]; the per-memory
  texture helpers (family, DEPTH, MemoryKey, memory_key, castable), the
  `switch` module and the loader's `publish` module stay built
  everywhere (their tests run on every host) and are allowed unused off
  Windows. The root-signature shim tests and the ID3D12Fence1 test,
  which drive Windows-only COM objects, are Windows-only.
- victory-gpu: silence unused parameters on the non-Windows paths of
  close/barrier/execute_indirect, matching reset().
- victory-hle: gate `function` (the System32 loader) and the
  Windows-only modules' imports; keep already-absolute and
  Windows-style absolute title paths on non-Windows hosts and resolve
  file names across both separators; gate the drive-over-folder mount
  test to Windows.
- victory-shader: gate the Windows-only imports of the emit tests;
  `Lowered::rovs` is read only by the GPU tests; the mesh test's
  program is built for the validator, which only Windows has.
- victory-loader/victory-pe: gate tests that read current_exe as PE.
- apps/victory: `translate --cache` (the warm-up and pre-build) fills
  the host's shader cache and pipeline library and is Windows-only;
  other hosts get an error saying so. Without the Windows DLLs, the
  validator and host pipelines are skipped with a note.

Linux: cargo build, cargo clippy --workspace --all-targets -D warnings
(default and --all-features) and cargo test --workspace --all-features
(26 suites, 394 passed) pass. Windows target (cargo-xwin): clippy
-D warnings, default and --all-features, passes. cargo xtask policy
passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the title-path shortcut returned an already-absolute path
unchanged, where `main` passed every path through `std::path::absolute`
(`GetFullPathNameW`: `/` becomes `\`, `..` is resolved), so a title
started as `C:/games/x/../game.exe` would read that raw string back
from `GetModuleFileName`. The shortcut now runs only on other hosts,
where a Windows-style path must not be joined to the host's current
directory; Windows behaves as before.

Tests: on Windows `C:/games/x/../game.exe` becomes `C:\games\game.exe`;
elsewhere drive-rooted, drive-root and UNC title paths are kept as
stored and a relative one is made absolute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…finds

`image_named` took the file name from a split at `\` and `/` on every
host. Windows keeps `Path::file_name` now, so nothing changes there;
the split is for other hosts, whose `Path::file_name` splits only at
`/`. A test checks both on each host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New code on main reaches items that are Windows-only off Windows:
texture_desc calls texture_memory (now Windows-only too), choose uses
IDLE_MS and IDLE_FRAMES (allowed unused off Windows, as choose and its
test need them), execute leaves `this` unused, and three new shader
tests validate DXIL, which only Windows has. Items only Windows code
uses, the new hold module among them, are allowed unused off Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ithout stubs

The inner cfg(windows) block of a test that is already Windows-only,
and a cfg(windows) import in a module that already is, go. translate's
host checks (the Checks field and its use) are Windows-only, so the
stand-in Host off Windows keeps only `new`, which fails, and the
unreachable stub shaders are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fallback samplers, the view heap page-table test, the audio heap's
host-allocator report and the text-entry style test reach Windows-only
modules; the validator test's lowered DXIL is mutated on Windows only.
After Marvisak#2670's job, with the same clippy gates as the Windows job.

@kotekompotek kotekompotek 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.

Scoped review: the Linux job mirrors the Windows one (clippy + all-features + tests), and the cfg-gating is mechanical — windows-only modules/import paths behind cfg(windows) with anyhow::Context split where needed. Catching non-Windows breakage in CI is worth the maintenance surface. LGTM.

@fuzeofficlal fuzeofficlal 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 head 5333d11c cleanly merged onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).

Code & Windows Regression Review

  • All #[cfg(windows)] / #[cfg(not(windows))] gates preserve Windows behavior cleanly (victory-hle/src/runtime.rs keeps std::path::absolute on Windows; PE current_exe() self-parse tests and Windows-only API/UI tests are gated appropriately; non-Windows Validator/Host stubs return clear errors).
  • crates/victory-shader/src/emit/lower.rs is 520,798 B (+235 B vs 63bcca43), safely under the 512 KiB limit.
  • Cross-PR note (#2907): #2907 calls victory_gpu::adapter_identity(), victory_gpu::set_caption_status(...), and crate::prebuild::run(...) unconditionally from apps/victory/src/startup.rs, so whichever PR lands second will need non-Windows #[cfg] gates/stubs there.

Local Verification (Windows 11 x64)

  • cargo clippy --locked --workspace --all-targets -- -D warnings (default and --features victory-gpu/diagnostics): clean.
  • cargo xtask policy: 191 files ok.
  • Passed full unit + integration test suites for victory (14+4), victory-core (13), victory-formats (46), victory-game (15), victory-hle (154+2), victory-loader (35+4), victory-pe (36), victory-pipeline (8), xtask (6).
  • victory-gpu (VICTORY_D3D12_DEBUG=1, --features diagnostics): RTX 5090 root::tests 11/11; WARP host::tests + descriptor::host::tests 31/31, root/list/queue/fence/resource/descriptor 47/47, frame::tests 2/2, placed_uav_tests 1/1.
  • victory-shader: emit::lower::tests + emit::tests 50/50 passed.

Looks clean on the Windows side and ready to merge.

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Proposed close. Out of scope. This makes the workspace build and test off Windows, with stubs and cfg gates across victory-gpu, victory-hle, victory-shader and apps/victory, plus a new linux job (with a third-party cache action) in .github/workflows/ci.yml. Other platforms are outside this project's scope, CI changes are the maintainer's call, and by its own description it re-packages #2334, another contributor's open PR. If a Windows-side fix is mixed in, please send it as its own small PR with evidence.

CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


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.

6 participants