Skip to content

Commit e210ab4

Browse files
committed
Replace obsolescent egrep with grep -E in lint script
Replace deprecated egrep command with the modern equivalent 'grep -E' to eliminate warnings about egrep being obsolescent. This improves the lint script output clarity without changing functionality. Also add codegen-backend override to prevent cranelift conflicts from parent directory configurations, ensuring rust-gpu builds with the required LLVM backend.
1 parent b19a858 commit e210ab4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ rustflags = [
1414
"-Zshare-generics=n", # =off is also an option, but you're going to increase binary size in doing so.
1515
]
1616

17+
# Override parent directory's cranelift backend setting for rust-gpu compatibility
18+
[profile.dev]
19+
codegen-backend = "llvm"
20+
1721
[target.'cfg(all())']
1822
rustflags = [
1923
# FIXME(eddyb) update/review these lints.

.github/workflows/lint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ 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).
5151
if (
52-
egrep -r '::\s*env|env\s*::' crates/rustc_codegen_spirv/src |
52+
grep -E -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+
grep -E -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\)$' |
5656
# HACK(LegNeato) exclude logging. This mirrors `rustc` (`RUSTC_LOG`) and
5757
#`rustdoc` (`RUSTDOC_LOG`).
5858
# 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};$'
59+
grep -E -v '^crates/rustc_codegen_spirv/src/lib.rs:.*(RUSTGPU_LOG|RUSTGPU_LOG_FORMAT|RUSTGPU_LOG_COLOR).*$' |
60+
grep -E -v '^crates/rustc_codegen_spirv/src/lib.rs: use std::env::{self, VarError};$'
6161

6262
); then
6363
echo '^^^'

0 commit comments

Comments
 (0)