ci: pin rust-toolchain + add clippy_report at release (active toolchain mgmt)#112
Merged
TigerInYourDream merged 4 commits intomainfrom Apr 21, 2026
Merged
ci: pin rust-toolchain + add clippy_report at release (active toolchain mgmt)#112TigerInYourDream merged 4 commits intomainfrom
TigerInYourDream merged 4 commits intomainfrom
Conversation
Run cargo clippy on every tag push / workflow_dispatch. Non-blocking: continue-on-error: true at job level plus "|| true" on the cargo invocation. The job writes a categorized warning summary to $GITHUB_STEP_SUMMARY (displayed at top of the Actions run page) and uploads the full clippy log as a 30-day artifact. Purpose: visibility into clippy state at release time, so new warnings introduced by upstream Rust/clippy releases can be reviewed during the regular packaging cycle rather than blocking random PR authors. Warning counts in the summary come from the #[warn(...)] annotations emitted by rustc/clippy (not the top-level "warning:" line), so cargo meta-warnings such as duplicate-package notices do not inflate the count. Companion to the CI policy change that retires RUSTFLAGS=-D warnings in favor of Cargo.toml [lints] as the sole lint policy source.
3 tasks
Switches from floating dtolnay/rust-toolchain@stable to actions-rust-lang/setup-rust-toolchain@v1 across all 14 workflow invocations (main.yml x1, builds.yml x7, release.yml x6). The new action honors rust-toolchain.toml as the single source of truth for the Rust version used by CI and local development. rust-toolchain.toml is pinned to 1.94.0 (current stable). The upgrade process is documented inline as TOML comments, so anyone opening the file to bump the version sees the checklist. Combined with retiring -D warnings and the clippy_report job in the preceding commit, robrix2 moves from passive toolchain drift to active control: CI uses the exact compiler specified in rust-toolchain.toml, local dev auto-installs the same version via rustup, toolchain bumps are deliberate maintainer-opened PRs, and clippy_report at release surfaces the lint state of the pinned toolchain.
…t CI actions-rust-lang/setup-rust-toolchain@v1 defaults to rustflags: "-D warnings" and exports that to $GITHUB_ENV, which silently re-injects strict mode into every subsequent step including cargo install of third-party crates. This was caught on PR #112's first CI run: cargo-makepad itself has an unused_variable warning (ndk_version at compile.rs:368) which normally is just a warning, but got promoted to an error by the injected RUSTFLAGS, failing all 4 mobile builds. Explicitly setting rustflags: "" on all 14 invocations disables the default injection. Lint policy remains entirely in Cargo.toml [lints.rust] and [lints.clippy], which is the whole point of the migration.
2 tasks
The original clippy_report job added in 9a02b40 was non-blocking: `continue-on-error: true` plus `|| true` on the cargo invocation, so a dirty clippy state at release time would show up only as a summary panel while the release publish steps still produced artifacts. That turned the job into pure visibility without discipline — warnings could accumulate on main indefinitely and still ship. This commit upgrades the semantics: * Removes `continue-on-error: true` at the job level and `|| true` on the cargo command; any warning or hard error now fails the job. * Splits the single "run + summarize" step into two: the run step is allowed to fail normally, while the summarize step carries `if: always()` so the GitHub step-summary panel and the clippy.log artifact are produced even on failure. Without the split, a dirty run would hide the categorized warning report that makes cleanup tractable. * Adds a final gate check in the summarize step that exits 1 with an `::error::` annotation when warn_count > 0 OR error_count > 0. Belt and suspenders alongside `set -o pipefail`. * Adds `clippy_report` to `create_release.needs` and extends its `if:` expression with `needs.clippy_report.result == 'success'`. Because the surrounding `always()` still evaluates the condition even when upstream jobs are skipped, the `result == 'success'` check is what actually cascades the block. A failed clippy_report skips create_release, which skips every downstream for_* build and publish job — no artifacts are produced with dirty clippy. * Renames the display to `Clippy Gate` (the job key stays `clippy_report` so the Swatinem cache key and upload-artifact name remain unchanged — no CI cache churn). Rationale: the CI policy retirement of `-D warnings` in #111 moved lint enforcement from "every PR, for every lint" to "Cargo.toml per-lint denies for author self-defects". That is intentionally lenient on style/perf/complexity/suspicious clippy warnings, which would otherwise make every Rust toolchain bump a PR-carpet-bombing event. The unavoidable consequence is that those warnings can accumulate on main between releases. The release hard gate is the scheduled cleanup trigger: it forces the maintainer to clear the backlog at the exact moment it matters — before shipping. Locally verified on the branch prior to push: current robrix code compiles clippy-clean (warn_count=0, error_count=0), so this change does not immediately block the next release. The first toolchain bump that promotes a lint from allow to warn in the `unused` or correctness group will fail the bump PR itself (by the layer-2 lint policy); anything lower-priority will surface at the next release and require a deliberate cleanup PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shifts robrix2 from passive Rust toolchain drift to active toolchain management by:
rust-toolchain.tomlto1.94.0(exact version, notstable).dtolnay/rust-toolchain@stabletoactions-rust-lang/setup-rust-toolchain@v1, which honorsrust-toolchain.tomlas the single source of truth.clippy_reportjob torelease.yml— runscargo clippy, renders a categorized warning summary to$GITHUB_STEP_SUMMARY, uploads the full log as a 30-day artifact.rust-toolchain.tomlas TOML comments, so anyone opening the file to bump the version sees the checklist.Why
Companion to #111, which retired
RUSTFLAGS: -D warnings. Together, these two PRs close the full loop:clippy_reportgives each release a moment of review: the lint state of the pinned toolchain is visible in the release run's summary panel, so the bump-review cycle has clear trigger points.Upgrade process (written into
rust-toolchain.toml)File changes
rust-toolchain.toml1.94.0; upgrade process documented as inline comments.github/workflows/main.yml.github/workflows/builds.ymltoolchain: stableremoved).github/workflows/release.ymlclippy_reportjobclippy_report mechanics
continue-on-error: trueat job level +|| trueon the cargo invocation — never blocks a release.#[warn(...)]annotations (not top-levelwarning:header lines), so cargo meta-warnings (e.g., duplicate-package notices) do not inflate the number.$GITHUB_STEP_SUMMARY(rendered at top of the Actions run page).clippy.logas a 30-day artifact for diff-over-time review.Test plan
rustup showrespects the pin (downloads 1.94.0, marks it as the active override)unused_variables,clippy::collapsible_if,clippy::useless_format)workflow_dispatchon release.yml with all build inputsfalseandcreate_release: false, confirmclippy_reportruns and the summary rendersCompanion PR
#111 retires
RUSTFLAGS: -D warningsand addsunused/dead_codedenies toCargo.toml [lints.rust]. Land that one first for smallest blast radius.