Skip to content

build: dev-fast profile + opt-in sccache/mold (card 424deb5e slices 1-3) - #1520

Merged
joelteply merged 1 commit into
canaryfrom
2983243c/build-time-quick-wins-dev-fast-profile-o
Jun 4, 2026
Merged

joelteply merged 1 commit into
canaryfrom
2983243c/build-time-quick-wins-dev-fast-profile-o

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Three config-only build-time wins from build-time doctrine card 424deb5e. Bundled as one PR because each is tiny and they share the same surface (workspace Cargo.toml + new src/workers/.cargo/config.toml).

  • Slice 3 — [profile.dev-fast] — new third lane between dev (ergonomic debug) and release (production perf). opt-level=0, debug="line-tables-only", codegen-units=256, incremental=true. For airc-work-claim iteration and hot-loop testing where you just want the binary to RUN.
  • Slice 1 — opt-in sccache — src/workers/.cargo/config.toml with commented sccache rustc-wrapper line + install instructions. Default behavior unchanged; devs opt in by installing sccache and uncommenting.
  • Slice 2 — opt-in mold/lld linker — same config file, commented per-target linker overrides (lld on macOS, mold on Linux) with install instructions. Cuts the 30-60s link step to 2-5s for devs who opt in.

Why opt-in for sccache/mold

Per [[no-fallbacks-ever]]: if we ship rustc-wrapper = "sccache" and the dev hasn't installed sccache, the build breaks with "command not found." Cleaner to require explicit opt-in than to ship "silently broken better defaults." Documented inline so devs see install instructions when they're already looking at the file.

Test plan

  • cargo check --profile dev-fast -p continuum-orm-derive succeeds (verified locally: 6.89s clean)
  • cargo check -p continuum-orm-derive default behavior unchanged (verified locally: 5.97s clean)
  • .cargo/config.toml has zero active settings (verified: grep -v '^#\|^$' returns empty)
  • CI green (will verify in PR checks)
  • No regression on Docker image build expected — config-only changes don't affect cargo-chef stages

Parent card

424deb5e — Build + boot time substrate doctrine. Sequences the remaining larger slices:

  1. Slices 1+2+3 → this PR
  2. Slice 4 — pre-built llama.cpp/whisper.cpp .a artifacts (biggest architectural lever; serves BOTH dev local builds AND Docker image rebuild cost via build.rs fetch-from-ghcr pattern)
  3. Slice 5 — GGUF-baked Docker image variant
  4. Slice 6 — GitHub Release binary attachments
  5. Slice 7 — Docker buildx multi-arch
  6. Slice 8 — Upstart benchmark + boot-ordering parallelization
  7. Slice 9 — Build-time + upstart CI regression gate

Doctrine

  • [[init-once-handle-then-lease-zero-copy-refs]] — sccache is the rustc-level lease-per-input cache (compile-time analogue of the runtime pattern)
  • [[organization-purity-as-we-migrate]] — opt-in pattern so we don't ship silently-broken better defaults
  • [[no-fallbacks-ever]] — config either works or is inert; no partial-degradation path

Targets canary per merge discipline.

🤖 Generated with Claude Code

…lices 1-3)

Three config-only build-time wins bundled because each is tiny and
shares the same surface (workspace Cargo.toml + new
src/workers/.cargo/config.toml).

## Slice 3 — [profile.dev-fast]

New profile inheriting `dev`. Settings:
- opt-level = 0 (fastest compile)
- debug = "line-tables-only" (panics still readable; ~30-50% smaller
  object files; meaningfully faster link)
- incremental = true (explicit for discoverability)
- codegen-units = 256 (parallel rustc)

Use case: hot-iter integration tests + airc work claim iteration —
"just make it run" not "measure perf" or "chase a panic". --dev stays
for ergonomic debug; --release stays for production.

Invoke: `cargo build --profile dev-fast` or `cargo test --profile dev-fast`.

## Slice 1 — opt-in sccache

`src/workers/.cargo/config.toml` created with sccache rustc-wrapper
COMMENTED + install instructions inline. Per
[[organization-purity-as-we-migrate]] + [[no-fallbacks-ever]] the
config doesn't ship a wrapper line that breaks builds for devs who
haven't installed sccache — opt-in by uncommenting.

Biggest win for the airc work claim flow: each worktree has its own
target/ but sccache backs them with one shared on-disk cache. Hit
rates of 80-95% on common changes; cold target/ feels warm.

## Slice 2 — opt-in mold/lld linker

Same `.cargo/config.toml`. Per-target linker override blocks
COMMENTED with install instructions:
- macOS arm64 / x86_64 → lld via brew install llvm
- Linux x86_64 / arm64 → mold via apt install mold

Default link step burns 30-60s per build on this codebase
(vendored llama.cpp + candle + tokio + all substrate crates).
mold/lld cuts that to 2-5s. Devs opt in by uncommenting their
platform's block + installing the linker.

## Doctrine

- [[init-once-handle-then-lease-zero-copy-refs]] — sccache is the
  rustc-level lease-per-input cache (compile-time analogue of the
  runtime pattern).
- [[organization-purity-as-we-migrate]] — opt-in pattern so we
  don't ship "silently broken better defaults".
- [[no-fallbacks-ever]] — config either works or is inert; no
  partial-degradation path.

## Test plan

- `cargo check --profile dev-fast -p continuum-orm-derive` succeeds
  (verified locally: 6.89s clean)
- `cargo check -p continuum-orm-derive` (default `dev`) unchanged
  (verified locally: 5.97s clean)
- `.cargo/config.toml` has zero active settings — all entries
  commented (verified: grep returns empty)
- No regression on existing Docker image build (config-only changes
  don't affect cargo-chef stages)

Card 424deb5e (the parent build-time doctrine card) sequences the
larger remaining slices: pre-built llama.cpp .a artifacts (biggest
architectural lever), GGUF-baked Docker image variant, GitHub
Release attachments, CI regression gate, upstart benchmark.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@joelteply
joelteply merged commit b948f5e into canary Jun 4, 2026
3 checks passed
@joelteply
joelteply deleted the 2983243c/build-time-quick-wins-dev-fast-profile-o branch June 4, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant