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

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

@⁠borosf on GitHub · 2026-11-25 11:53 UTC · original
borosf:vibe/dev-qol-842ca5 → main · +43 −0 · 1 files · 1 commits · open

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 — #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.
**@⁠borosf** on GitHub · 2026-11-25 11:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2362) `borosf:vibe/dev-qol-842ca5` → `main` · +43 −0 · 1 files · 1 commits · open ## 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 — #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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:03:32 +00:00
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 12:05 UTC · original

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.

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 12:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7161897337) **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: ```sh 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.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-25 12:56 UTC · original

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.

**@⁠cloph-dsp** on GitHub · 2026-11-25 12:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7163059089) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 14:46 UTC · original · edited 2026-11-26 00:20 UTC

Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The head is unchanged since the last triage (c7c4da7). The new cargo xtask check in xtask/src/main.rs reads correctly, but a new xtask command that spawns cargo check for another target is tooling the maintainer has to want first.

On your reply: agreed. Add the clang-cl/llvm-lib line only if the maintainer takes the command. Nothing else is needed from you for now. CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 14:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7165803435) · edited 2026-11-26 00:20 UTC <!-- victory-triage v1 head=c7c4da741cc5b220cc60fc6a311f5e78b8a780b2 verdict=needs-work at=2026-11-26T00:20:32Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** The head is unchanged since the last triage (`c7c4da7`). The new `cargo xtask check` in `xtask/src/main.rs` reads correctly, but a new xtask command that spawns `cargo check` for another target is tooling the maintainer has to want first. On your reply: agreed. Add the `clang-cl`/`llvm-lib` line only if the maintainer takes the command. Nothing else is needed from you for now. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠borosf on GitHub · 2026-11-25 17:16 UTC · original

Understood that the command itself needs the maintainer's want. If it's taken: the thread's clang-cl datapoint is worth folding in as a doc line — the whole workspace, victory-gpu included, type-checks for the Windows target from Linux with 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 — happy to add that sentence if that's the direction.

**@⁠borosf** on GitHub · 2026-11-25 17:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7169254322) Understood that the command itself needs the maintainer's want. If it's taken: the thread's clang-cl datapoint is worth folding in as a doc line — the whole workspace, victory-gpu included, type-checks for the Windows target from Linux with 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 — happy to add that sentence if that's the direction.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2362'
git switch 'github-bot/gh-2362'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2362'
git switch 'github-bot/gh-2362'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2362'
git switch 'main'
git merge --squash 'github-bot/gh-2362'
git switch 'main'
git merge --ff-only 'github-bot/gh-2362'
git switch 'main'
git merge 'github-bot/gh-2362'
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!2362
No description provided.