Skip to content

[worker:deadcode:rust] suppress false-positive machete build-deps in remote-proto - #1169

Merged
bryan-minimal merged 2 commits into
mainfrom
chore/remote-proto-machete-build-deps-1799a26e1b213d2e
Aug 7, 2026
Merged

[worker:deadcode:rust] suppress false-positive machete build-deps in remote-proto#1169
bryan-minimal merged 2 commits into
mainfrom
chore/remote-proto-machete-build-deps-1799a26e1b213d2e

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Resolves the dead-code finding in #1157. cargo-machete flagged two [build-dependencies] of remote-protoprost-build and tonic-prost-build — as unused, but both are false positives: they are build-time codegen deps invoked directly from crates/remote-proto/build.rs (prost_build::compile_protos() at line 11, tonic_prost_build::configure().compile_protos() at line 25) to compile the .proto files. cargo-machete's source scan does not trace them, so removing them would break the build.

What changed

  • crates/remote-proto/Cargo.toml — extended the existing [package.metadata.cargo-machete] ignored list to include prost-build and tonic-prost-build, matching the pattern already used to suppress the runtime deps (prost, prost-types, tonic, tonic-prost). Updated the explanatory comment to cover the build-time reason.

This is a metadata-only edit: no dependency was added or removed, [dependencies]/[build-dependencies] are unchanged, and Cargo.lock is untouched. No .rs source was modified.

Verification

My cargo build --workspace --all-targets self-check from ./target passed (finished clean; metadata-only change, so compilation is unaffected). No .rs file was touched, so no cargo fmt was required. The non-bypassable host backstop still re-runs the full gate before this PR opens: cargo fmt --all --check, cargo build --workspace --all-targets --locked, cargo clippy --workspace --all-targets --locked -- -D warnings, and cargo test --workspace --all-targets --locked.

Closes #1157

Generated by Chore-issue worker agent (side-repo-ops operator) ·

Note

Suppress false-positive cargo-machete warnings for build deps in remote-proto

Adds prost-build and tonic-prost-build to the [package.metadata.cargo-machete] ignored list in Cargo.toml, which previously triggered false-positive "unused dependency" warnings. Expands the inline comment to clarify the distinction between runtime and build-time deps.

Macroscope summarized 07e3d09.

Summary by CodeRabbit

  • Chores
    • Updated dependency analysis configuration to account for indirectly used build-time and runtime components.
    • Reformatted the configuration for improved readability.

prost-build and tonic-prost-build are build-time codegen deps invoked
from build.rs; cargo-machete's source scan flags them as unused even
though they are required. Add them to the [package.metadata.cargo-machete]
ignored list alongside the runtime deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner August 4, 2026 00:51
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change expands cargo-machete metadata in crates/remote-proto/Cargo.toml to ignore six indirectly used prost and tonic dependencies, including two build dependencies.

Changes

Remote protocol dependency metadata

Layer / File(s) Summary
Cargo-machete ignore metadata
crates/remote-proto/Cargo.toml
The metadata documents indirect runtime and code-generation usage and ignores prost, prost-types, tonic, tonic-prost, prost-build, and tonic-prost-build.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

  • gominimal/minimal#1157 — Updates the same cargo-machete ignore list for indirect prost and tonic dependencies.

Suggested reviewers: norrietaylor

Poem

I nudge the manifest with paws so light,
Six tonic friends now rest in sight.
Build-time helpers join the queue,
While cargo-machete knows what to do.
Hop, hop—metadata is tidy and true!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the false-positive cargo-machete build-dependency suppression in remote-proto.
Description check ✅ Passed The description explains the change, reason, affected dependencies, verification, and issue reference; the required information is substantially complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remote-proto-machete-build-deps-1799a26e1b213d2e

Comment @coderabbitai help to get the list of available commands.

@bryan-minimal
bryan-minimal enabled auto-merge (squash) August 6, 2026 16:11
@bryan-minimal
bryan-minimal merged commit 50e2a1a into main Aug 7, 2026
30 checks passed
@bryan-minimal
bryan-minimal deleted the chore/remote-proto-machete-build-deps-1799a26e1b213d2e branch August 7, 2026 20:35
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.

[deadcode:rust] 2 false-positive build-dependency candidates in remote-proto

2 participants