ci: cache Rust dependencies for release builds and drop codegen-units=1 from the dist profile - #1724
Merged
Merged
Conversation
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.
📊 Code coverage
Gate: line coverage must stay at or above the threshold. Ratchet plan (W21): Backend → 55%, CLI → 50%, Frontend → 30% by quarter end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
main, but not caches saved by earlier tags, so every release compiled all dependencies from scratch.distprofile usedcodegen-units = 1, so the largenyxid-clicrate compiled and optimized on one core.What
release-cache.yml. It builds the samedist planmatrix as the release (same runners, containers, packages anddist buildarguments) onmainand saves a per-target Rust dependency cache.Cargo.lock,Cargo.tomlor the release workflows, a daily run, and manual dispatch.release.yml.build-local-artifactsrestores that cache (restore-only, same shared key) beforedist build.Cargo.toml. Thedistprofile dropscodegen-units = 1and keeps the release default of 16. Thin LTO and strip are unchanged.Measured (local Apple Silicon, clean
distbuild of nyxid-cli)codegen-units = 1nyxid-clibinaryCI 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