Skip to content

Commit db7f1c8

Browse files
maxholmanclaude
andcommitted
fix(build): strip unused vergen cargo/rustc features to reduce deps
VERGEN_CARGO_* and VERGEN_RUSTC_* env vars were emitted by build.rs but never referenced in source. The cargo feature pulled in cargo_metadata + derive_builder, adding unnecessary build-dep weight and lockfile churn. Slim-glibc was 2% over the 5MiB bloat threshold. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 825f2f8 commit db7f1c8

6 files changed

Lines changed: 5 additions & 61 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench/check_bloat.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mkdir -p "$RESULTS_DIR"
2121
cd "$ROOT_DIR"
2222

2323
# --- Size thresholds (bytes) ---
24+
# DO NOT BUMP WITHOUT PERMISSION.
2425
# Updated: 2026-03-15, baseline: worktree-mcp-server
2526
# slim threshold = exactly 5MiB (5 * 1024 * 1024). Must stay "5MB slim".
2627
# default threshold = existing measured + ~1% headroom.

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ wallhackd = { path = "../daemon", default-features = false }
5151
zeroize = "1"
5252

5353
[build-dependencies]
54-
vergen-gitcl = { version = "9.1", features = ["build", "cargo", "rustc"] }
54+
vergen-gitcl = { version = "9.1", features = ["build"] }
5555

5656
[lints]
5757
workspace = true

crates/cli/build.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use vergen_gitcl::{BuildBuilder, CargoBuilder, Emitter, GitclBuilder, RustcBuilder};
1+
use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder};
22

33
fn main() -> Result<(), Box<dyn std::error::Error>> {
44
// PROFILE is a standard Cargo build env var; emit it for use via env!() in source.
@@ -10,13 +10,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1010
Emitter::default()
1111
.add_instructions(&BuildBuilder::default().build_timestamp(true).build()?)?
1212
.add_instructions(&GitclBuilder::default().sha(true).dirty(true).build()?)?
13-
.add_instructions(
14-
&CargoBuilder::default()
15-
.target_triple(true)
16-
.features(true)
17-
.build()?,
18-
)?
19-
.add_instructions(&RustcBuilder::default().semver(true).build()?)?
2013
.emit()?;
2114
Ok(())
2215
}

crates/mcp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ wallhack-ipc = { path = "../ipc", features = ["vsock"] }
1616
wallhack-wire = { path = "../wire" }
1717

1818
[build-dependencies]
19-
vergen-gitcl = { version = "9.1", features = ["build", "cargo"] }
19+
vergen-gitcl = { version = "9.1", features = ["build"] }
2020

2121
[lints.rust]
2222
unsafe_code = "deny"

crates/mcp/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use vergen_gitcl::{BuildBuilder, CargoBuilder, Emitter, GitclBuilder};
1+
use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder};
22

33
fn main() -> Result<(), Box<dyn std::error::Error>> {
44
println!(
@@ -8,7 +8,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
88
Emitter::default()
99
.add_instructions(&BuildBuilder::default().build_timestamp(true).build()?)?
1010
.add_instructions(&GitclBuilder::default().sha(true).dirty(true).build()?)?
11-
.add_instructions(&CargoBuilder::default().target_triple(true).build()?)?
1211
.emit()?;
1312
Ok(())
1413
}

0 commit comments

Comments
 (0)