Skip to content

[worker:deadcode:rust] remove unused nix dependency from minimald - #448

Merged
norrietaylor merged 3 commits into
mainfrom
chore/deadcode-remove-nix-minimald-1fe66b2d53015f98
Jun 18, 2026
Merged

[worker:deadcode:rust] remove unused nix dependency from minimald#448
norrietaylor merged 3 commits into
mainfrom
chore/deadcode-remove-nix-minimald-1fe66b2d53015f98

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves the agent:deadcode:rust finding in #390. cargo-machete flagged two unused dependencies in minimald; 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 nix appears in no source file in the crate. The Linux-only low-level code uses libc::mount/libc::chroot and tokio-vsock directly. Since cfg(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 by crates/minimald/src/session_host.rs and crates/minimald/src/env.rs (use mfile::{EnvPatches, EnvVarValue}), so removing it would break the build. Left in place.

Cargo.lock is regenerated to drop the now-unused nix edge from minimald; other crates depending on nix are unaffected.

Verification

  • cargo build --workspace --all-targets — passed locally (exit 0; minimald compiles cleanly without nix), confirming nix was genuinely unused.
  • cargo fmt --all applied (no Rust sources changed).
  • The host backstop 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 #390

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

Summary by CodeRabbit

  • Chores
    • Updated build configuration with minor cleanup adjustments.

Note: This is a maintenance release with no user-facing changes.

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.
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6d6e9cf0-8b3b-4a50-81e3-ea6cf979335c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removes the nix.workspace = true entry from the Linux-only dependency block in crates/minimald/Cargo.toml. No source code changes are made; the remaining Linux-specific dependency tokio-vsock.workspace is unaffected.

Changes

Remove unused nix dependency from minimald

Layer / File(s) Summary
Drop nix from Linux-only dependencies
crates/minimald/Cargo.toml
Removes nix.workspace = true from the [target.'cfg(target_os = "linux")'.dependencies] section; no other entries are modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

  • #390 ([deadcode:rust] 1 dead-code candidate across 1 crate): This PR directly addresses one of the two surviving findings from that issue — the nix dependency flagged by cargo-machete as unused in crates/minimald/Cargo.toml.

Possibly related PRs

  • gominimal/minimal#288: Also removes unused dependencies (futures.workspace, tokio-util.workspace) from crates/minimald/Cargo.toml, the same manifest file.
  • gominimal/minimal#308: Also removes unused dependency entries (bytes, uuid) from crates/minimald/Cargo.toml.

Suggested reviewers

  • norrietaylor

Poem

🐇 One line fewer, the manifest grows lean,
nix was declared but was never seen.
No use nix:: found in any file,
machete confirmed it — gone in style.
Cleaner Cargo, lighter crate, hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: removing the unused nix dependency from minimald, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR removes the unused nix dependency as required by issue #390, verified by cargo build success. The mfile dependency was correctly retained per the PR objectives noting it was a false positive.
Out of Scope Changes check ✅ Passed All changes are directly scoped to removing the unused nix dependency from minimald's Cargo.toml, which aligns with the issue #390 requirements and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

norrietaylor and others added 2 commits June 17, 2026 20:38
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>
@norrietaylor
norrietaylor enabled auto-merge (squash) June 18, 2026 15:52
@norrietaylor
norrietaylor merged commit e5c1218 into main Jun 18, 2026
16 checks passed
@norrietaylor
norrietaylor deleted the chore/deadcode-remove-nix-minimald-1fe66b2d53015f98 branch June 18, 2026 15:53
gominimal-aw-bot Bot added a commit that referenced this pull request Jul 29, 2026
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>
twitchyliquid64 pushed a commit that referenced this pull request Jul 29, 2026
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>
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] 1 dead-code candidate across 1 crate

2 participants