From 6bea1420bbfa66fb3990560c300be8d5660e6fce Mon Sep 17 00:00:00 2001 From: chappie-daemon Date: Fri, 20 Nov 2026 19:46:47 -0500 Subject: [PATCH] chore(test): stop writing debug info into test binaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing in this repository reads it. The 66 integration-test binaries in this workspace are 81% DWARF by weight — one measured 236 MB unstripped against 45 MB stripped — and every consumer (cargo test, clippy, fmt, CI, the review lenses) either never opens a symbol table or reads a panic location, which the compiler emits with or without debug info. Measured 2026-11-21 from a cold target dir on -p nostream-mcp --test auth: profile binary build target dir dev (default, 2) 230 MB 75 s 1.6 GB line tables (1) 150 MB 54 s 1.3 GB none (0) 43 MB 49 s 0.8 GB The test profile is the one that matters: cargo test runs it, so it decides the size of every artifact a test run leaves behind. dev keeps the default, because cargo build output is the one artifact a person opens in a debugger by hand. --- .changeset/test-profile-no-debuginfo.md | 6 ++++++ Cargo.toml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .changeset/test-profile-no-debuginfo.md diff --git a/.changeset/test-profile-no-debuginfo.md b/.changeset/test-profile-no-debuginfo.md new file mode 100644 index 000000000..50c83ff8f --- /dev/null +++ b/.changeset/test-profile-no-debuginfo.md @@ -0,0 +1,6 @@ +--- +--- + +chore(test): stop writing debug info into test binaries + +Nothing in this repository reads it: `cargo test`, `clippy`, `fmt`, CI and the review lenses either never open a symbol table or print a panic location, which the compiler emits regardless. It was 81% of a 236 MB test binary. Measured from a cold target dir on `-p nostream-mcp --test auth`: binary 230 MB → 43 MB, build 75 s → 49 s, target dir 1.6 GB → 0.8 GB. `dev` keeps the default, because `cargo build` output is the one artifact a person opens in a debugger. Rust-only, so this changeset is empty on purpose: no published package changes. diff --git a/Cargo.toml b/Cargo.toml index 807a8f890..296031713 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,6 +59,26 @@ tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] } url = "2" uuid = { version = "1", features = ["v4"] } +# Nothing reads debug info here. The 66 integration-test binaries this workspace links are +# 81% DWARF — one measured 236 MB unstripped against 45 MB stripped, and `.debug_str` alone +# was 75 MB of what line-tables-only still wrote — and every consumer in this repository +# (`cargo test`, `clippy`, `fmt`, the factory's lenses, CI) either never opens it or prints a +# panic location, which the compiler emits with or without it (`#[track_caller]`). +# `cargo test` runs the `test` profile, so this is the profile that decides the size of every +# artifact a test run leaves behind. +# +# Measured 2026-11-21 on `-p nostream-mcp --test auth` from a cold target dir: +# +# profile binary build target dir +# dev (default, 2) 230 MB 75 s 1.6 GB +# line tables (1) 150 MB 54 s 1.3 GB +# none (0) 43 MB 49 s 0.8 GB +# +# `dev` deliberately keeps the default: `cargo build` artifacts are for a debugger to open by +# hand, and that is the one case where the bytes are read. Everything automated uses `test`. +[profile.test] +debug = 0 + [workspace.lints.rust] # `deny` rather than `forbid`: heed's LMDB `EnvOpenOptions::open` is an `unsafe fn` # (heed 0.20.5, src/env.rs:236) and the storage crate wraps it in exactly one