Skip to content

xtask: type-check the Windows target from any host - #2362

Open
borosf wants to merge 1 commit into
Marvisak:mainfrom
borosf:vibe/dev-qol-842ca5
Open

borosf wants to merge 1 commit into
Marvisak:mainfrom
borosf:vibe/dev-qol-842ca5

Conversation

@borosf

@borosf borosf commented Nov 25, 2026

Copy link
Copy Markdown

Summary

  • cargo xtask check type-checks for x86_64-pc-windows-msvc from any host: code behind
    #[cfg(windows)] (the whole victory-shader GPU test harness among it) does not compile
    for a plain cargo check off Windows, so its type errors first appear in CI — an E0283
    in an untyped CreateDescriptorHeap reached the review of another PR exactly that way,
    and a reviewer's machine time found it before CI did. The crates that bind blake3's C code
    (victory-gpu and everything below it) cannot cross-build without a Windows-capable C
    toolchain, so the command covers the rest and its docs say which and why.
  • Deliberately not included: a pull request template — GitHub: rebase issue forms and PR template on main #113 already carries one.

claiming: new (not in CLAIMS.md; commenting from this account is blocked by the
integration's permissions, so the claim rides this pull request).

Verification

  • cargo run -p xtask --locked -- check: passes on Linux after
    rustup target add x86_64-pc-windows-msvc (a target the toolchain file already pins);
    the same check is what caught the Windows-only type error above before a push.
  • cargo run -p xtask --locked -- policy: 183 files ok.
  • cargo clippy -p xtask --all-targets --locked -- -D warnings: clean in both clippy
    configurations CI runs.
  • No game data; the change is repository tooling only.

Co-authored-by: borosf <borosf@users.noreply.github.com>
@ntgata1-dotcom

Copy link
Copy Markdown

Linux: works as described, and the crates it leaves out type-check from Linux too

Arch Linux, Rust 1.98.1 from rust-toolchain.toml, at c7c4da7:

  • cargo xtask check passes, with no CC or AR variables set.

  • The crates it leaves out (victory-gpu and the crates that need it) also type-check for the Windows target from Linux when cc uses LLVM's clang-cl. This passes for the whole workspace from an empty target folder in 15 s:

    CC_x86_64_pc_windows_msvc=clang-cl AR_x86_64_pc_windows_msvc=llvm-lib \
      cargo check --workspace --all-targets --locked --target x86_64-pc-windows-msvc

    That's clang/LLVM 23.1.5 from Arch's clang and llvm packages, with no Windows SDK. blake3's build script compiles its x86-64 assembly with clang-cl (blake3_sse2_sse41_avx2_assembly.lib, blake3_avx512_assembly.lib). cargo xwin clippy --workspace --all-targets passes as well, but it downloads the MSVC CRT and Windows SDK.

So the command could check the whole workspace when clang-cl and llvm-lib are on PATH, and keep today's five crates otherwise. That's your call; it works as it is.

AI-assisted (Claude Code); numbers from my own runs.

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

Tested locally: merged into main 940d32f, cargo test -p xtask --locked on macOS arm64 — 6 passed, 0 failed. Approving — xtask type-checks the Windows target from any host (useful exactly for non-Windows dev machines).

@cloph-dsp

Copy link
Copy Markdown

Independent local validation for VIctory PR #2362 (Windows, Rust 1.100.0/MSVC, head c7c4da7, no game data/DRM): cargo run -p xtask --locked -- check -> exit 0; cargo run -p xtask --locked -- policy -> asset policy: 182 files ok, exit 0; cargo check --workspace --all-targets --locked --target x86_64-pc-windows-msvc -> exit 0 (only pre-existing fetch_update deprecation warnings). This host is MSVC without clang-cl, so it confirms the xtask check path works on a second Windows toolchain setup. I did not test from a non-Windows host, nor run clippy (Scoop Rust lacks the component). AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only type-check). No game data, assets or extracted content used.

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.

5 participants