Skip to content

Fix CI clippy and audit failures - #3

Merged
rksm merged 3 commits into
masterfrom
rksm/fix-ci
Sep 23, 2026
Merged

rksm merged 3 commits into
masterfrom
rksm/fix-ci

Conversation

@rksm

@rksm rksm commented Sep 23, 2026 •

Copy link
Copy Markdown

CI failed on master in run 35845927658. The Lint and Test job and the Audit job failed for separate reasons. The first two commits fix one each. The third commit removes a network request from the tests.

Lint and Test: clippy needless_doctest_main

Clippy reports needless_doctest_main on the permanent error and retry doctests in src/lib.rs. Clippy 1.96.1 and 1.98.1 report it. Clippy 1.85, which the dev shell pins, and 1.89 do not.

The lint fires because seven crate doc lines have no space after //! (lines 12, 15, and 22 to 26). Rustdoc then strips no leading space from the crate docs, so each code block keeps a one-space indent. When a fenced code block has an indent, the Markdown parser emits each line as its own text event. Clippy checks each text event on its own, and the line fn main() { alone matches the lint.

The first commit removes the fn main wrappers. Rustdoc adds main around a doctest by itself, so the doctests behave the same. This fix works with every clippy version. Adding the missing spaces would also silence the lint, but only because of how clippy splits the text.

Audit: vulnerable crates in Cargo.lock

cargo audit found seven vulnerabilities. All come in through the reqwest dev-dependency. The second commit updates the affected crates to patched versions within their semver range:

Crate From To Advisories
bytes 1.10.1 1.12.1 RUSTSEC-2026-0007
h2 0.4.12 0.4.19 RUSTSEC-2026-0258
rustls 0.23.34 0.23.45 RUSTSEC-2026-0285
rustls-webpki 0.103.7 0.103.15 RUSTSEC-2026-0049, RUSTSEC-2026-0098, RUSTSEC-2026-0099, RUSTSEC-2026-0104

Cargo ignores the Cargo.lock of a dependency, so this change does not affect users.

The "Security audit" check is the check run that rustsec/audit-check creates. It passes when the Audit job passes.

These audit warnings remain, but they do not fail the job:

  • async-std and bincode are unmaintained.
  • rand 0.9.2 and event-listener 5.4.1 are unsound.

Retry doctest: no network request

The retry doctest fetched https://www.rust-lang.org in cargo test. When that request fails, retry keeps trying for up to 15 minutes, but the CI job times out after 10 minutes. The third commit marks the doctest no_run, like the permanent error doctest. It still compiles in tests.

Testing

I ran each CI step locally with Rust 1.98.1:

  • cargo clippy --all-targets --features tokio -- -D warnings
  • cargo clippy --all-targets --target wasm32-unknown-unknown -- -D warnings
  • cargo test --features tokio
  • cargo test --doc
  • cargo audit (no vulnerabilities, 4 warnings)

Extra checks outside CI:

  • cargo fmt -- --check, from the lint recipe in the justfile.
  • The crate still builds with rustc 1.85 from the dev shell.

Clippy 1.98 reports needless_doctest_main on the permanent error and
retry doctests. Rustdoc wraps a doctest in main on its own, so the
explicit wrapper is not needed. The doctests keep the same behavior.
cargo audit fails the CI audit job on seven advisories. All come in
through the reqwest dev-dependency. Update the affected crates to
patched versions within their semver range:

- bytes 1.10.1 -> 1.12.1 (RUSTSEC-2026-0007)
- h2 0.4.12 -> 0.4.19 (RUSTSEC-2026-0258)
- rustls 0.23.34 -> 0.23.45 (RUSTSEC-2026-0285)
- rustls-webpki 0.103.7 -> 0.103.15 (RUSTSEC-2026-0049,
  RUSTSEC-2026-0098, RUSTSEC-2026-0099, RUSTSEC-2026-0104)

Cargo ignores the Cargo.lock of a dependency, so this change does not
affect users.
The retry doctest fetches https://www.rust-lang.org. When that request
fails, retry keeps trying for up to 15 minutes, the default
max_elapsed_time. The CI job times out after 10 minutes, so a network
problem would make the job hang until that timeout.

Mark the doctest no_run, like the permanent error doctest. It still
compiles in tests but makes no request.
@rksm
rksm merged commit 88efba8 into master Sep 23, 2026
2 checks passed
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.

1 participant