ci: switch to Cargo build.warnings#6212
Conversation
|
Heads up — CI surfaced a subtlety that makes this more than a drop-in swap. The Windows This isn't a real code warning — it's the This seemed to contradict the stabilization promise that (The Options as I see them:
Leaning towards 1/2 — happy to adjust to whichever you prefer. |
|
I disagree with any of the (seemingly LLM-assisted) root-cause analysis/options above. The linker warning is almost certainly from |
|
You're right, and apologies. I think my mistake came before the analysis itself: CI broke on my change, and instead of questioning my own approach, I assumed the code where the failure showed up was the root cause and started digging into it (with AI). That assumption was wrong from the start. Your point is the actual issue: I'd like to fix that first and rebase this on top. Shall I open a separate issue + PR for it? |
Closes #6205.
Replaces
RUSTFLAGS=-D warningswith Cargo'sbuild.warnings(CARGO_BUILD_WARNINGS=deny) for the rustc-warning paths, so CI no longer cache-busts local builds —RUSTFLAGSis part of cargo's fingerprint,build.warningsis not.Two things I kept separate from a straight swap:
build.warningsis only respected on Cargo 1.97+. PyO3's MSRV is 1.83 and the MSRV jobs run throughbuild.yml/check-feature-powerset, so there the setting is silently ignored and warnings stay non-fatal until the MSRV reaches 1.97; stable jobs still enforce them. I kept this simple rather than gating per-toolchain, since it self-resolves.build.warningscovers rustc build warnings but not rustdoc, so I leftRUSTDOCFLAGS=-D warnings(and thedocsnox session) in place.Verified locally on 1.97.1 that
CARGO_BUILD_WARNINGS=denyturns warnings into errors forcargo build,test, andhack check, and is ignored on 1.95.(AI-assisted; the MSRV/rustdoc analysis and final decisions are my own.)