Skip to content

Enforce -Dwarnings in CI instead of in the manifest - #3447

Open
plusky wants to merge 1 commit into
rtk-ai:developfrom
plusky:ci/deny-warnings-in-ci-not-manifest
Open

Enforce -Dwarnings in CI instead of in the manifest#3447
plusky wants to merge 1 commit into
rtk-ai:developfrom
plusky:ci/deny-warnings-in-ci-not-manifest

Conversation

@plusky

@plusky plusky commented Aug 5, 2026

Copy link
Copy Markdown

Second of two packaging papercuts found while packaging rtk for openSUSE (the other is #3446).

[lints.rust] warnings = "deny" applies to every build of rtk, not just the ones CI runs. CI pins its toolchain with dtolnay/rust-toolchain@stable; distributions do not — openSUSE Tumbleweed is on rustc 1.97 against a rust-version = "1.91" floor. Every rustc release adds or widens lints, so the first one that touches rtk turns a warning nobody has seen yet into a hard build failure for every downstream consumer simultaneously, and the only escape is patching Cargo.toml.

This moves the enforcement to where it belongs:

  • drop warnings = "deny" from [lints.rust]
  • set RUSTFLAGS: -Dwarnings on the clippy and test jobs in ci.yml

CI fails on warnings exactly as it does today — and now covers dependency builds too, which the manifest lint did not. A newer toolchain outside CI degrades to a warning that can be fixed on your normal schedule rather than breaking the build.

unsafe_code = "deny" stays in the manifest: that is a deliberate design constraint of the crate, not lint drift.

Happy to put the env at workflow level instead if you would rather have it apply to every job — I kept it to the two that compile so the "Clippy security lints" step, which greps its own output for warning:, keeps behaving as written.

`warnings = "deny"` in [lints.rust] applies to every build of rtk, not
just the ones CI runs. That is a problem for anyone building with a
toolchain other than the one CI pins: a rustc newer than rust-version
routinely adds or widens a lint, and the first release that does so turns
a warning nobody has seen yet into a hard build failure for every
downstream consumer at once, with no way to opt out short of patching
Cargo.toml.

Set RUSTFLAGS: -Dwarnings on the clippy and test jobs instead. CI keeps
failing on warnings exactly as before -- and now covers the dependency
build too -- while `cargo build` with a newer toolchain degrades to a
warning that can be fixed on the normal schedule.

unsafe_code = "deny" stays in the manifest: that one is a deliberate
design constraint of the crate, not lint drift.
@CLAassistant

CLAassistant commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants