oxidecomputer / oxidecomputer/omicron

omicron builds fail when clippy is unhappy with code from dependencies

Open
#4,888 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

When trying to bump the dendrite version, omicron CI builds started failing because clippy was unhappy with some of the code imported from dpd-client:

2098    2024-01-23T21:44:13.181Z            --> /work/oxidecomputer/omicron/target/debug/build/dpd-client e0a00b57212e7804/out/dpd-client.rs:3333:9
2099    2024-01-23T21:44:13.181Z             |
2100    2024-01-23T21:44:13.181Z        3333 | /         let mut query = Vec::with_capacity(1usize);
2101    2024-01-23T21:44:13.181Z        3334 | |         query.push(("force_sync", force_sync.to_string()));
2102    2024-01-23T21:44:13.181Z             | |___________________________________________________________^ help: consider using the `vec![]` macro: `let query = vec![..];`
2103    2024-01-23T21:44:13.181Z             |
2104    2024-01-23T21:44:13.181Z             = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
2105    2024-01-23T21:44:13.182Z             = note: `-D clippy::vec-init-then-push` implied by `-D warnings`
2106    2024-01-23T21:44:13.182Z             = help: to override `-D warnings` add `#[allow(clippy::vec_init_then_push)]`

(from the build log at https://github.com/oxidecomputer/omicron/runs/20791167193)

Ideally progenitor would generate clippy-clean code (https://github.com/oxidecomputer/progenitor/issues/701) or include a directive to clippy to ignore it. Regardless, it seems odd that we would be running clippy on external crates as part of the omicron build process.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced Omicron CI build log and the generated target/debug/build/dpd-client/out/dpd-client.rs location to understand why dependency-generated code is checked by clippy. Review progenitor issue #701 for the proposed generator-side solution. Done means the Omicron build no longer fails on clippy warnings originating from external generated code.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.