Skip to content

ci: Opt the workspace into clippy's await-holding lints (RUST-019, #2715) - #2716

Merged
zackees merged 1 commit into
masterfrom
infra/2715-rust019-await-holding-lints
Oct 28, 2026
Merged

zackees merged 1 commit into
masterfrom
infra/2715-rust019-await-holding-lints

Conversation

@zackees

@zackees zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member

Closes #2715.

[workspace.lints.clippy] opted the workspace in to wildcard_imports and enum_glob_use only, so ci-lint's RUST-019 findings on Cargo.toml (three violations, no exception) meant the awaits-holding lints were unset: clippy::await_holding_lock, clippy::await_holding_refcell_ref, clippy::await_holding_invalid_type.

Why

A Mutex/RefCell guard that lives across an .await makes the future !Send or deadlocks the runtime when the executor polls the task again on the same thread — and it surfaces as a hang, not a diagnostic. All three are pedantic lints, so they never fire unless the workspace opts in.

The workspace has no async code today (git grep '\.await' -- rust ':!rust/tools' matches only the test helper await_parked in rust/obs-util/tests/platform/nix_inhibit.rs), which is exactly when to turn them on: the first async caller then cannot land the bug.

Change

RED → GREEN

RED, on origin/master (d82a994e4):

ci-lint precheck: 24 violation(s), 488 approved exception(s), 31 needs_review
== RUST-019 (3) ==
[RUST-019] VIOLATION Cargo.toml   (await_holding_lock / await_holding_refcell_ref / await_holding_invalid_type)

GREEN, this branch (328b781e6):

ci-lint precheck: 21 violation(s), 488 approved exception(s), 31 needs_review

grep -c RUST-019 on the second report is 0 and the rule's section is gone; nothing else moved.

The repo's own clippy lane command passes on the branch with the lints denied — no guard-across-await exists to fire:

soldr cargo clippy --locked --workspace --all-targets -- -D warnings
    Finished `dev` profile [unoptimized] target(s) in 45.94s

(That run also proves the three lint names are known to the pinned toolchain: an unknown lint is an unknown_lints warning, which -D warnings turns into an error.)

Not applicable

  • No docs/features.md line: a lint configuration change has no user-visible behaviour.
  • No ci/test_*.py pin: ci-lint precheck is the rule's own checker and runs offline against Cargo.toml; the repo's tests are stdlib-only hand parsers of workflow YAML, and a second parser of [workspace.lints.clippy] would duplicate the rule rather than pin behaviour this repo owns.

Refs #2715.

)

`[workspace.lints.clippy]` opted in to wildcard_imports and enum_glob_use
only, so the three pedantic lints that catch a lock or RefCell guard living
across an `.await` never fired. A guard held across an await makes the
future !Send or deadlocks the runtime, and it surfaces as a hang, not a
diagnostic.

The workspace has no async code yet (the only `.await` text match under
`rust/` is the test helper `await_parked`), which is exactly when to set
them: the first async caller cannot land the bug.

No clippy.toml entry is needed -- the std guard types are covered by the
built-in lints, and the workspace registers no blocking wrapper type.

ci-lint precheck: 24 violation(s), 488 approved exception(s), 31
needs_review -> 21 violation(s), 488 approved exception(s), 31
needs_review (RUST-019 gone).

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review — verified, queueing.

  • Diff is the three pedantic await-holding lints denied under [workspace.lints.clippy] plus a comment naming the failure mode; every member already carries [lints] workspace = true, so no member file needs to change.
  • RED → GREEN is honest: ci-lint precheck on master reports RUST-019 (3) for Cargo.toml with no exception, and the branch's report has no RUST-019 section and nothing else moved.
  • The lint names are real for the pinned toolchain — -D warnings over soldr cargo clippy --locked --workspace --all-targets would turn an unknown_lints warning into an error, so a green run is evidence the three are known and unfired.
  • No docs/features.md line and no new ci/test_*.py pin are both correct: lint configuration is not user-visible, and ci-lint precheck is already the rule's checker.

Checks: CI Gate ✅, Fast Gate ⚡, Tier 2 Linux lanes all green, mergeStateStatus CLEAN.

@zackees
zackees added this pull request to the merge queue Oct 28, 2026
Merged via the queue into master with commit 79d34d2 Oct 28, 2026
37 checks passed
@zackees
zackees deleted the infra/2715-rust019-await-holding-lints branch October 28, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

infra: Cargo.toml leaves clippy::await_holding_lock / await_holding_refcell_ref / await_holding_invalid_type unset (RUST-019)

1 participant