@@ -49,10 +49,16 @@ clippy_no_features examples/shaders/simplest-shader
4949# which could be disastrous because env vars access can't be tracked by
5050# `rustc`, unlike its CLI flags (which are integrated with incremental).
5151if (
52- egrep -r ' ::\s*env|env\s*::' crates/rustc_codegen_spirv/src/ |
52+ egrep -r ' ::\s*env|env\s*::' crates/rustc_codegen_spirv/src |
5353 # HACK(eddyb) exclude the one place in `rustc_codegen_spirv`
5454 # needing access to an env var (only for codegen args `--help`).
55- egrep -v ' ^crates/rustc_codegen_spirv/src/codegen_cx/mod.rs: let help_flag_comes_from_spirv_builder_env_var = std::env::var\(spirv_builder_env_var\)$'
55+ egrep -v ' ^crates/rustc_codegen_spirv/src/codegen_cx/mod.rs: let help_flag_comes_from_spirv_builder_env_var = std::env::var\(spirv_builder_env_var\)$' |
56+ # HACK(LegNeato) exclude logging. This mirrors `rustc` (`RUSTC_LOG`) and
57+ # `rustdoc` (`RUSTDOC_LOG`).
58+ # There is not a risk of this being disastrous as it does not change the build settings.
59+ egrep -v ' ^crates/rustc_codegen_spirv/src/lib.rs:.*(RUSTGPU_LOG|RUSTGPU_LOG_FORMAT|RUSTGPU_LOG_COLOR).*$' |
60+ egrep -v ' ^crates/rustc_codegen_spirv/src/lib.rs: use std::env::{self, VarError};$'
61+
5662); then
5763 echo ' ^^^'
5864 echo ' !!! Found disallowed `std::env` usage in `rustc_codegen_spirv` !!!'
@@ -87,3 +93,16 @@ function version_test() {
8793# FIXME(eddyb) try to get this working for `spirv-builder`, which has a larger
8894# dependency graph, with too much imprecision in upstream `Cargo.toml` files.
8995version_test crates/spirv-std
96+
97+ # 3. Ensure `rustc_codegen_spirv` still compiles with `rustc_codegen_ssa`.
98+
99+ # HACK(eddyb) see `crates/rustc_codegen_spirv/build.rs` for more on `pqp_cg_ssa`
100+ # (a patched copy of `rustc_codegen_ssa`).
101+ echo ::group::rustc_codegen_spirv_disable_pqp_cg_ssa
102+ cargo clippy \
103+ --manifest-path " crates/rustc_codegen_spirv/Cargo.toml" \
104+ --no-default-features \
105+ --features " $FEAT " \
106+ --all-targets \
107+ -- -D warnings --cfg rustc_codegen_spirv_disable_pqp_cg_ssa
108+ echo ::endgroup::
0 commit comments