Skip to content

chore(test): stop writing debug info into test binaries - #1204

Merged
cameri merged 1 commit into
rewrite/mainfrom
perf/dev-profile-line-tables
Nov 21, 2026
Merged

cameri merged 1 commit into
rewrite/mainfrom
perf/dev-profile-line-tables

Conversation

@chappie-daemon

Copy link
Copy Markdown
Collaborator

Stops writing debug info into test binaries, because nothing in this repository reads it.

Measured

-p nostream-mcp --test auth, each from a cold CARGO_TARGET_DIR, same tree:

profile binary build target dir
dev default (debug = 2) 230 MB 75 s 1.6 GB
line tables (debug = 1) 150 MB 54 s 1.3 GB
none (debug = 0) 43 MB 49 s 0.8 GB

debug = 1 is the surprise: line tables alone kept 107 MB of debug info, 75 MB of it .debug_str, so it buys a third of the win for the same lost debugging. The full profile is worth nothing here and line tables are barely worth anything.

Why nobody needs it

Every consumer either never opens a symbol table or does not need one:

  • cargo test, clippy, fmt, cargo check — no symbol reader in the path.
  • CI builds fresh on its own runner; the artifacts under test are never inspected.
  • A failing assertion prints its assert_eq! diff from values, not from DWARF, and a panic's file:line comes from #[track_caller] and Location, which the compiler emits regardless.

The one case that does read it — attaching a debugger to a binary by hand — is cargo build output, which is why [profile.test] is the only profile changed and dev keeps its default.

Why it matters for the factory

One review round links a test binary per integration-test target — 66 of them in this workspace — each statically carrying the crate graph. A single five-round job left 13 target directories and ~55 GB in /tmp in one day and the disk reached 7.8 GB free. At these numbers that job's trees would have been about 28 GB, and each build is 35% faster.

Scope

One Cargo.toml profile and an empty changeset. cargo test -p nostream-mcp --test auth passes: 11 passed, 0 failed. Nothing else in the tree is touched.

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-bot

changeset-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6bea142

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9b96062c-a139-42d4-ad0c-4c4e7014656f

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Sets debug = 0 in [profile.test] to reduce test build time and disk use. Leaves [profile.dev] unchanged.

  • Test builds drop debug info while ordinary builds keep it.

Reviews (1) · Last reviewed commit: "chore(test): stop writing debug info int..." · Reviewed by Greptile

@cameri
cameri enabled auto-merge November 21, 2026 00:50
@cameri
cameri merged commit 9d2c15e into rewrite/main Nov 21, 2026
18 checks passed
@cameri
cameri deleted the perf/dev-profile-line-tables branch November 21, 2026 00:54
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.

2 participants