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

Open
borosf wants to merge 1 commit from upstream-pr/2362 into main
borosf commented 2026-11-25 11:53:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T11:53:52Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5490812439 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T11:53:52Z. --- ## 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.
catminou4 commented 2026-11-25 12:35:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T12:35:53Z.

Review: APPROVED


Tested locally: merged into main 940d32f69b, 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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6057694863 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#pullrequestreview-6057694863). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T12:35:53Z. **Review:** APPROVED --- Tested locally: merged into main 940d32f69b, `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).
ntgata1-dotcom commented 2026-11-25 13:02:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T12:05:04Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7161897337 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7161897337). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T12:05:04Z. --- **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.
cloph-dsp commented 2026-11-25 13:03:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T12:56:06Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7163059089 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7163059089). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-25T12:56:06Z. --- 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.
Marvisak commented 2026-11-25 15:04:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:46:51Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165803435 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7165803435). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T14:46:51Z. --- <!-- 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)_
borosf commented 2026-11-25 18:02:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T17:16:10Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169254322 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7169254322). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T17:16:10Z. --- 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 commented 2026-11-27 10:52:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T10:52:12Z.


This one is waiting on a yes/no that only the maintainer can give: the triage says the cargo xtask check command reads correctly but a new xtask command that spawns cargo check for another target is tooling you have to want first.

So, a direct question to settle it: do you want a cross-target cargo xtask check in the tree? If yes I will add the clang-cl / llvm-lib note the triage asked for and it is ready to merge; if no, I will close this and keep the type-check out of the tree rather than leave it sitting in the queue.

State is otherwise clean: head c7c4da74, CI green, merges cleanly with current main, no other open points from the triage.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216403773 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2362#issuecomment-7216403773). Originally posted by [borosf](https://github.com/borosf) on 2026-11-27T10:52:12Z. --- This one is waiting on a yes/no that only the maintainer can give: the triage says the `cargo xtask check` command reads correctly but a new xtask command that spawns `cargo check` for another target is tooling you have to want first. So, a direct question to settle it: **do you want a cross-target `cargo xtask check` in the tree?** If yes I will add the `clang-cl` / `llvm-lib` note the triage asked for and it is ready to merge; if no, I will close this and keep the type-check out of the tree rather than leave it sitting in the queue. State is otherwise clean: head `c7c4da74`, CI green, merges cleanly with current `main`, no other open points from the triage.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2362:upstream-pr/2362'
git switch 'upstream-pr/2362'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2362'
git switch 'upstream-pr/2362'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2362'
git switch 'upstream-pr/2362'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2362'
git switch 'main'
git merge --squash 'upstream-pr/2362'
git switch 'main'
git merge --ff-only 'upstream-pr/2362'
git switch 'main'
git merge 'upstream-pr/2362'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2360
No description provided.