Shaders: build the constant-colour test shader only on Windows, where its tests run #258

Closed
SkippySteve wants to merge 1 commit from upstream-pr/258 into main
SkippySteve commented 2026-11-24 01:53:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:53:12Z.


constant_color() in crates/victory-shader/src/emit/mod.rs is only called by two #[cfg(windows)] tests (stub_pipeline_is_created, constant_color_validates), but the helper itself had no gate. On Linux the test build warns function constant_color is never used, so cargo clippy -p victory-shader --all-targets -- -D warnings fails.

This gates the helper on windows and moves its two imports (bitcode::Attr, shader::Shader) into the function body, because nothing else in the test module uses them and they would otherwise become unused imports.

No behaviour change. The Windows tests compile and run exactly as before.

Checked on Linux:

  • cargo clippy -p victory-shader --all-targets -- -D warnings: clean (it failed before this change)
  • cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings: clean
  • cargo test -p victory-shader: 56 passed
  • cargo fmt --check, cargo xtask policy: ok
<!-- greyfinch-sync:Marvisak/VIctory:issue:6572805077 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/258). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:53:12Z. --- `constant_color()` in `crates/victory-shader/src/emit/mod.rs` is only called by two `#[cfg(windows)]` tests (`stub_pipeline_is_created`, `constant_color_validates`), but the helper itself had no gate. On Linux the test build warns `function constant_color is never used`, so `cargo clippy -p victory-shader --all-targets -- -D warnings` fails. This gates the helper on `windows` and moves its two imports (`bitcode::Attr`, `shader::Shader`) into the function body, because nothing else in the test module uses them and they would otherwise become unused imports. No behaviour change. The Windows tests compile and run exactly as before. Checked on Linux: - `cargo clippy -p victory-shader --all-targets -- -D warnings`: clean (it failed before this change) - `cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc -- -D warnings`: clean - `cargo test -p victory-shader`: 56 passed - `cargo fmt --check`, `cargo xtask policy`: ok
upstream-sync closed this pull request 2026-11-24 06:52:05 +00:00
SkippySteve commented 2026-11-24 06:55:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:55:41Z.


superseded by #262 (combined: keep helper + hermetic Linux container test)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119587526 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/258#issuecomment-7119587526). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:55:41Z. --- superseded by #262 (combined: keep helper + hermetic Linux container test)

Pull request closed

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!258
No description provided.