Skip to content

ci: cache Rust dependencies for release builds and drop codegen-units=1 from the dist profile - #1724

Merged
chronoai-kai merged 3 commits into
mainfrom
ci/release-build-speed
Oct 1, 2026
Merged

chronoai-kai merged 3 commits into
mainfrom
ci/release-build-speed

Conversation

@chronoai-kai

Copy link
Copy Markdown
Contributor

Why

Release builds (the CLI binaries) took 21–30 min on Linux and 24–120 min on macOS for identical work. The release waits for the slowest platform. Two causes:

  • Cache scope. Release builds run only for tags. A tag run can restore Actions caches saved on main, but not caches saved by earlier tags, so every release compiled all dependencies from scratch.
  • Serial final compile. The dist profile used codegen-units = 1, so the large nyxid-cli crate compiled and optimized on one core.

What

  • New workflow release-cache.yml. It builds the same dist plan matrix as the release (same runners, containers, packages and dist build arguments) on main and saves a per-target Rust dependency cache.
    • Triggers: pushes that change Cargo.lock, Cargo.toml or the release workflows, a daily run, and manual dispatch.
    • The daily run restores each cache, refreshing it against the repository's least-recently-used eviction (the cache store is already at about 10.6 GB), and rebuilds only on a miss.
  • release.yml. build-local-artifacts restores that cache (restore-only, same shared key) before dist build.
  • Cargo.toml. The dist profile drops codegen-units = 1 and keeps the release default of 16. Thin LTO and strip are unchanged.

Measured (local Apple Silicon, clean dist build of nyxid-cli)

codegen-units = 1 default (16)
Full build 257 s 174 s (−32%)
Final nyxid-cli binary 141 s 73 s (−48%)
Binary size 23.3 MB 28.2 MB

CI runners have fewer cores, so both the serial final compile and the dependency builds weigh more there. The cache removes the dependency part on warm runs.

Notes

  • The warm workflow runs once when this merges, because its own file changed. The first release after that run completes restores a warm cache.
  • No version bump: no product change.

chrono-kw added 3 commits October 1, 2026 16:06
…=1 from the dist profile

Release builds only run for tags, and a tag run cannot restore caches saved by
earlier tags, only those saved on main. A new Release Build Cache workflow
builds the same dist matrix on main (on dependency or workflow changes, daily,
or on demand) and saves a per-target dependency cache; the daily run restores
each cache to keep it from being evicted and rebuilds only on a miss.
release.yml restores that cache (restore-only) before dist build.

The dist profile now keeps the release default of 16 codegen units. Locally a
full dist build of nyxid-cli drops from 257 s to 174 s, and the final binary
from 141 s to 73 s, for a 23.3 MB to 28.2 MB binary.
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

📊 Code coverage

Component Lines Threshold Status Δ vs base
Backend (nyxid) 87.55% 73% ✅ 🔺 +0.01
CLI (nyxid-cli) 71.22% 64% ✅ — 0.00
Frontend (vitest) 71.61% 15% ✅ — 0.00

Gate: line coverage must stay at or above the threshold. Ratchet plan (W21): Backend → 55%, CLI → 50%, Frontend → 30% by quarter end.

@chronoai-kai
chronoai-kai merged commit f6cd8f6 into main Oct 1, 2026
40 checks passed
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.

1 participant