Skip to content

ci: restore green CI (protoc install + fmt drift + clippy lints)#16

Merged
yhyyz merged 5 commits into
ourmem:mainfrom
doctatortot:upstream-clean/ci-install-protoc
May 20, 2026
Merged

ci: restore green CI (protoc install + fmt drift + clippy lints)#16
yhyyz merged 5 commits into
ourmem:mainfrom
doctatortot:upstream-clean/ci-install-protoc

Conversation

@doctatortot
Copy link
Copy Markdown
Contributor

@doctatortot doctatortot commented May 19, 2026

Summary

Peeled back four layers of latent CI brokenness in one PR. Each fix surfaced the next layer:

  1. cargo fmt -- --check — fixed two small drifts (same as chore: cargo fmt new code in 3472c74 + my test #11, which is now closed as superseded).
  2. protoc not installed — added apt-get install protobuf-compiler before the rust toolchain step.
  3. google/protobuf/empty.proto not found — also installed libprotobuf-dev (well-known proto types live there, not in protobuf-compiler).
  4. 7 clippy lints in upstream code treated as errors by -D warnings. Rust 1.95 (installed by dtolnay/rust-toolchain@stable) added useless_into_iter and unnecessary_sort_by. Mechanical fixes, no behavior change.

CI was green when the fmt step was failing first because nothing past fmt ran. With each underlying layer fixed, the next surfaced. All four are now addressed.

Why this was masked until now

For weeks, CI bailed at cargo fmt -- --check on 229 sites of fmt drift across upstream main. The fmt cleanup in 508e9e6 unblocked that gate. PR #11 fixed two small fresh fmt drifts on top of that. With fmt finally green, clippy ran — and surfaced first the missing-protoc dep, then the missing-wkt dep, then the new lints.

Nothing in CI was broken by recent contributor changes — it's just layers being peeled back one gate at a time. None of the clippy lints would have failed CI before rust 1.95.

Three currently-open PRs blocked by this

Verified locally

cargo clippy --lib -- -D warnings is clean after the lint fixes. Full lib test suite was 386/386 pass on the supersede branch before, no behavior regressions here.

🤖 Generated with Claude Code

doctatortot and others added 2 commits May 19, 2026 07:03
`lance-encoding`'s build.rs invokes `protoc` to generate prost bindings.
Without it `cargo clippy` and `cargo test` fail at compile time with
"Could not find `protoc`. If `protoc` is installed, try setting the
`PROTOC` environment variable..."

This was masked previously because CI bailed at the `cargo fmt --check`
step (229 sites of fmt drift across upstream main). After the fmt
cleanup in 508e9e6, PRs now reach the clippy step and surface this dep.
Three currently-open PRs (ourmem#11 ourmem#12 ourmem#14) hit this on their last CI runs.

Adding `apt-get install protobuf-compiler` before the rust toolchain
step matches the standard pattern for Rust projects with prost-build
deps (see lancedb, datafusion, deltalake CI configs).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Same content as ourmem#11 — folding into this PR so a single merge fixes
everything currently broken in CI.

- 5 long `format!` chains in api/mod.rs from the percent-encoding fix
  in 3472c74 — now wrapped to per-line args
- One `.iter().find().unwrap()` chain in pipeline.rs from the
  `test_rrf_normalize_weak_top_not_inflated` test added in ourmem#9

Pure fmt, no logic.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@doctatortot doctatortot changed the title ci: install protoc so clippy and test can build lance-encoding ci: install protoc and fix fmt drift so CI can reach test step May 19, 2026
doctatortot and others added 2 commits May 19, 2026 07:14
`protobuf-compiler` only ships the `protoc` binary; the
`google/protobuf/empty.proto` and friends that lance-encoding's .proto
files import live in `libprotobuf-dev` under
/usr/include/google/protobuf/.

Without both, clippy gets past the missing-protoc stage and dies on
"google/protobuf/empty.proto: File not found" instead.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
The CI workflow runs `cargo clippy -- -D warnings`. Rust 1.95
(installed by dtolnay/rust-toolchain@stable) added two new lint
categories that hit upstream code:

- 4× `useless_into_iter` on `stream::iter(x.into_iter())` —
  `stream::iter` accepts `IntoIterator` directly. (sharing.rs:516,
  924, 1090, 1263)
- 3× `unnecessary_sort_by` on `sort_by(|a, b| b.1.cmp(&a.1))` —
  `sort_by_key(|t| std::cmp::Reverse(t.1))` is the clippy-preferred
  form for "reverse-sort on a field." (stats.rs:307, 557, 761)

Mechanical fixes only — no behavior change. `cargo clippy --lib --
-D warnings` is clean locally after.

Other `sort_by` call sites with multi-field or date-based comparisons
aren't flagged (clippy is precise about which closures are reducible
to a key function).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@doctatortot doctatortot changed the title ci: install protoc and fix fmt drift so CI can reach test step ci: restore green CI (protoc install + fmt drift + clippy lints) May 19, 2026
Removing `.into_iter()` made the call expressions shorter, so rustfmt
wants the surrounding multi-line blocks in sharing.rs re-wrapped to a
tighter form. Pure fmt, no logic.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@doctatortot
Copy link
Copy Markdown
Contributor Author

Green now ✅ — mergeable_state: clean, all checks passing.

Took 4 iterations because each fix surfaced the next latent gate. For posterity:

Iter Layer surfaced Commit
v1 fmt drift on yesterday's commits (folded into b4ec7ed/07db99f)
v2 protoc not installed b4ec7ed
v3 google/protobuf/empty.proto not found (wkt deps) a2fe097
v4 7 clippy lints from rust 1.95 (useless_into_iter, unnecessary_sort_by) e07c1f8
v5 rustfmt re-wrap on shortened lines from v4 eaf4678

Worth noting: as far as I can tell this is the first PR to actually reach a green CI run in upstream main in weeks — the fmt gate was perpetually red, so nothing past it (clippy, test) had any signal. With #16 landed, every future PR gets real CI feedback instead of just a fmt-fail.

Ready whenever you are. After this lands I'll rebase #12 and #14.

@yhyyz yhyyz merged commit 909c8ec into ourmem:main May 20, 2026
1 check passed
@yhyyz
Copy link
Copy Markdown
Contributor

yhyyz commented May 20, 2026

Merged! Thanks @doctatortot — this is a huge quality-of-life improvement for CI. First green run on upstream main in weeks. 🎉

Go ahead and rebase #12 and #14 whenever you're ready.

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