[worker:deadcode:rust] remove unused nix dependency from minimald - #448
Conversation
cargo-machete flagged nix as unused in minimald (issue #390). The crate is declared under the cfg(target_os = "linux") target deps but has no nix:: references in any source file; the Linux-only low-level code uses libc and tokio-vsock directly. Removing it keeps the workspace building cleanly on Linux (nix's only target). The same issue also flagged mfile, but that is a false positive: mfile is imported by session_host.rs and env.rs, so it is left in place.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughRemoves the ChangesRemove unused nix dependency from minimald
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
The previous commit regenerated Cargo.lock against a stale crates.io index, downgrading hundreds of unrelated packages and adding a spurious wit-bindgen/wasm-* tree. That lockfile no longer satisfied the manifests under the current index, so `cargo fetch --locked` failed in the test and artifacts CI jobs. Reset Cargo.lock to the base branch and re-resolve, yielding the correct minimal change: a single removed `nix 0.31.3` edge from the minimald dependency node. The two nix package entries remain, still used by other crates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cargo-machete's hygiene check flagged `either` as declared in crates/minimald/Cargo.toml with no use in the crate, turning the nightly-tests hygiene job red. Searching crates/minimald confirms the crate never references the either crate: every `either`/`Either` occurrence is the English word inside a comment. Remove the orphaned declaration, matching prior unused-dep cleanups in minimald (chrono in #594, nix in #448). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cargo-machete's hygiene check flagged `either` as declared in crates/minimald/Cargo.toml with no use in the crate, turning the nightly-tests hygiene job red. Searching crates/minimald confirms the crate never references the either crate: every `either`/`Either` occurrence is the English word inside a comment. Remove the orphaned declaration, matching prior unused-dep cleanups in minimald (chrono in #594, nix in #448). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Resolves the
agent:deadcode:rustfinding in#390. cargo-machete flagged two unused dependencies inminimald; this PR removes the genuinely-unused one and documents the other as a false positive.nix— removed. Declared under[target.'cfg(target_os = "linux")'.dependencies]but never referenced —nix::/use nixappears in no source file in the crate. The Linux-only low-level code useslibc::mount/libc::chrootandtokio-vsockdirectly. Sincecfg(target_os = "linux")is the crate's build target on the runner, the build fully exercises this removal.mfile— kept (false positive). It is imported bycrates/minimald/src/session_host.rsandcrates/minimald/src/env.rs(use mfile::{EnvPatches, EnvVarValue}), so removing it would break the build. Left in place.Cargo.lockis regenerated to drop the now-unusednixedge fromminimald; other crates depending onnixare unaffected.Verification
cargo build --workspace --all-targets— passed locally (exit 0;minimaldcompiles cleanly withoutnix), confirmingnixwas genuinely unused.cargo fmt --allapplied (no Rust sources changed).cargo fmt --all --check,cargo build --workspace --all-targets --locked,cargo clippy --workspace --all-targets --locked -- -D warnings, andcargo test --workspace --all-targets --locked.Closes #390
Summary by CodeRabbit
Note: This is a maintenance release with no user-facing changes.