Update cfg_aliases in order to fix unexpected cfg condition warnings#6348
Update cfg_aliases in order to fix unexpected cfg condition warnings#6348Wumpf wants to merge 2 commits into
cfg_aliases in order to fix unexpected cfg condition warnings#6348Conversation
|
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.
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 confront users with warnings which they'll 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.
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.
🤷 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 :( |
|
Discussed this in our 2024-11-13 maintainers' meeting agenda. Let's close in favor of #6105. |
Connections
cfgcondition warnings for cfgs defined bybuild.rs#6347Description
(title)
Testing
run
cargo clippywith 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-emscriptencargo xtask testto run tests.CHANGELOG.md. See simple instructions inside file.