-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cfg_aliases
in order to fix unexpected cfg condition warnings
#6348
base: trunk
Are you sure you want to change the base?
Conversation
I'm surprised this PR isn't running into the issues that motivated katharostech/cfg_aliases#10, which is why I'd kept similar changes held back in #6105. 🤔 Will try out these changes locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, yeah, CI is printing many warnings like this (link):
warning: wgpu-hal@22.0.0: cargo:rustc-check-cfg requires -Zcheck-cfg flag
...but it's not failing CI. wat?
🤔 If @gfx-rs/wgpu thinks that this is acceptable for downstream to endure, I suppose we could merge something like this. It's not likely to break downstream, but it will throw up warnings that users will be confronted (and have no leverage to resolve) if they're not on Rust 1.77 or higher. On principle, that sounds like a very downstream-hostile thing to do, and I'd strongly prefer we simply wait until MSRV is 1.77 or higher.
Gonna hit Request changes
until we get consensus on the above.
[lints.rust] | ||
# The `wgpu_validate_locks` config is supposed to be set via `RUSTFLAGS='--cfg wgpu_validate_locks'` | ||
# If set, `wgpu-core` uses the [`ranked`] module's locks. We hope to make this the default for debug builds soon. | ||
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(wgpu_validate_locks)'] } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: I've implemented something similar to this in this commit in #6105 as build.rs
output instead:
println!("cargo::rustc-check-cfg=cfg(wgpu_validate_locks)");
The reason I did this was because I felt it made more sense to keep the cfg
config (😆) in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 no preference really, but I see you found one more than me.
So I can just cherry-pick your commit over
I've also observed the warning you cite in other projects which why I ignored it as well here, not thinking about it. Didn't get to the bottom of why this happens so far :( |
Connections
cfg
condition warnings for cfgs defined bybuild.rs
#6347Description
(title)
Testing
run
cargo clippy
with deleted rust-toolchain.toml file-> Turns out we do have one condition that needs to be ignored,
wgpu_validate_locks
(cc: @jimblandy )Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.