Skip to content

Commit

Permalink
Add tracing to rustc_codegen_spirv
Browse files Browse the repository at this point in the history
Fixes #192
  • Loading branch information
LegNeato committed Jan 3, 2025
1 parent bfa63c1 commit cc9b40d
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 52 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ clippy_no_features examples/shaders/simplest-shader
# which could be disastrous because env vars access can't be tracked by
# `rustc`, unlike its CLI flags (which are integrated with incremental).
if (
egrep -r '::\s*env|env\s*::' crates/rustc_codegen_spirv/src/ |
egrep -r '::\s*env|env\s*::' crates/rustc_codegen_spirv/src |
# HACK(eddyb) exclude the one place in `rustc_codegen_spirv`
# needing access to an env var (only for codegen args `--help`).
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\)$'
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\)$' |
# HACK(LegNeato) exclude logging. This mirrors `rustc` (`RUSTC_LOG`) and
#`rustdoc` (`RUSTDOC_LOG`).
# There is not a risk of this being disastrous as it does not change the build settings.
egrep -v '^crates/rustc_codegen_spirv/src/lib.rs:.*(RUSTGPU_LOG|RUSTGPU_LOG_FORMAT|RUSTGPU_LOG_COLOR).*$' |
egrep -v '^crates/rustc_codegen_spirv/src/lib.rs: use std::env::{self, VarError};$'

); then
echo '^^^'
echo '!!! Found disallowed `std::env` usage in `rustc_codegen_spirv` !!!'
Expand Down
Loading

0 comments on commit cc9b40d

Please sign in to comment.