Skip to content

ci-local's VM target dirs are ~39 GB each, and 96% of that is debug info #655

Description

@TinDang97

Measured

scripts/ci-local.sh builds two VM-local cargo target dirs (monoio + tokio legs). Each is ~39 GB, so the pair is ~75 GB on moon-dev's 111 GB root. Measured 2026-08-22:

~/ci-target/local-monoio/          39 GB
  debug/deps/                      32 GB
    238 test executables           30.5 GB   avg 128 MB, largest 251 MB
    297 rlibs (the actual deps)     1.0 GB
  debug/incremental/                4.9 GB

tests/ holds 233 integration test files. Each is its own crate statically linked against the whole moon lib plus every dependency, so the dep graph is duplicated 233 times.

~96% of each test binary is DWARF. One 191 MB test binary drops to 8 MB under strip --strip-debug. So of the 30.5 GB of test executables, roughly 29 GB is debug info and ~1.5 GB is code.

Why it matters

The failure mode is silent and reads as a code failure. When the VM root fills, OrbStack wedges: the leg exits rc=1 with no error text (the log shows only Compiling moon), orb run then answers sconrpc ready event fired but socket was not connectible, and orb list shows the machine stopping. This happened on PR #654 — the monoio leg had already passed 5885/5885 and the tokio leg died mid-compile purely from disk pressure.

Proposed fix

[profile.dev]
debug = "line-tables-only"

Panic messages carry file:line from #[track_caller] regardless of this setting, and line tables keep backtraces readable. Nothing in these suites is run under a debugger. Expected effect, from the strip measurement: ~30 GB → single-digit GB per target dir, and proportionally faster linking.

Worth checking as part of the change:

  • a panicking test still reports a useful backtrace with RUST_BACKTRACE=1
  • the crash-matrix suites, which inspect core dumps / stack traces if any do
  • wall-clock delta on a cold cargo nextest run (link time should drop)

Also worth considering

238 test binaries from 233 files is a lot of duplicated linking. Consolidating related suites into fewer crates would compound the win, but that is a larger refactor and should not block the one-line profile change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions