From 791c9572841445b045daada15b1affd7a3e23208 Mon Sep 17 00:00:00 2001 From: Fabio Nunes <52166187+LittleGuava@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:52:54 -0300 Subject: [PATCH] chore(build): keep only line tables in dev builds (#1260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full debug info made up most of target/: each worktree's build output was 15–30 GB. Dev builds now keep line tables for workspace crates (file:line stays in backtraces) and no debug info for dependencies, which brings a cold `cargo build` to about 9 GB and roughly halves cold build time. A debugger can't show locals any more; re-enable with `--config profile.dev.debug=true` when needed. Co-authored-by: LittleGuava <52166187+LittleGuava@users.noreply.github.com> --- AGENTS.md | 4 ++-- Cargo.toml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1b667bd8a..54cc95ae4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -121,8 +121,8 @@ Several worktrees can be developed and run side by side. default MCP session belongs to this worktree. - Keep each worktree's Cargo output directory separate; do not point `CARGO_TARGET_DIR` or `target` symlinks at a shared directory. -- Each worktree's first build is cold (around 5 minutes) and its Cargo output takes - 15–30 GB. Avoid running several heavy builds on one machine at the same time. +- Each worktree's first build is cold (several minutes) and `cargo build` output takes + around 9 GB; tests, clippy and incremental builds add more. Avoid running several heavy builds on one machine at the same time. - Stop only processes started for the current worktree/session. Never use broad process-name kills such as `pkill openidea`. - When done: stop that worktree's app and dev session, delete its build output, then diff --git a/Cargo.toml b/Cargo.toml index 551afa8c9..ea4e1506d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,8 +117,14 @@ tempfile = "3" [profile.dev] # Keep debug builds snappy while giving dependencies decent speed. opt-level = 0 +# Full debug info is most of target/. Line tables keep file:line in our backtraces, but a +# debugger can't show locals; re-enable with `--config profile.dev.debug=true`. +debug = "line-tables-only" [profile.dev.package."*"] opt-level = 2 +# Dependency frames keep function names only. Re-enable one with +# `--config 'profile.dev.package..debug=true'`. +debug = false [profile.release] codegen-units = 1