Skip to content

ci: disable incremental compilation and debug info in CI#9

Open
huth-stacks wants to merge 1 commit into
developfrom
ci/P8-ci-env-optimizations
Open

ci: disable incremental compilation and debug info in CI#9
huth-stacks wants to merge 1 commit into
developfrom
ci/P8-ci-env-optimizations

Conversation

@huth-stacks

Copy link
Copy Markdown
Owner

What

Disable incremental compilation and debug info generation in the CI test cache build.

Why

Two env var defaults hurt CI performance:

CARGO_INCREMENTAL (default: 1 in dev profile): Incremental compilation adds tracking
overhead (~10%) to clean builds and bloats the target directory, making cache save/restore
slower. CI builds are almost always clean — there's no prior state to be incremental against.
Every major Rust CI optimization guide recommends CARGO_INCREMENTAL=0.

CARGO_PROFILE_DEV_DEBUG (default: 2): Full debug info increases binary size, link time,
and cache size. CI runners don't need debug symbols for interactive debugging.

The Change

In .github/workflows/create-cache.yml, add two env vars:

+  CARGO_INCREMENTAL: "0"
+  CARGO_PROFILE_DEV_DEBUG: "0"

2 lines added in 1 file.

Metrics to Track

Metric Baseline Expected
nextest-archive build time ~15-19m -10% (~1.5-2m saved)
Target directory size ~2.6GB ~1.5-2GB

Security Checklist

  • No new permissions
  • No secrets exposure
  • Standard Rust CI best practice

Part of CI Optimization Series

PR 8. Quick-win env var optimizations.

Set CARGO_INCREMENTAL=0 and CARGO_PROFILE_DEV_DEBUG=0 for the test
cache build. Incremental compilation adds ~10% overhead on clean CI
builds and bloats the target directory. Debug info level 2 (default)
increases binary size and link time without benefit in CI where we
don't debug interactively.
@huth-stacks huth-stacks added the no changelog Skip changelog fragment check label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog Skip changelog fragment check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant