Skip to content

refactor(build): scope size tuning to a dedicated dist profile#720

Merged
joshjhall merged 1 commit into
mainfrom
feature/issue-700
Jul 5, 2026
Merged

refactor(build): scope size tuning to a dedicated dist profile#720
joshjhall merged 1 commit into
mainfrom
feature/issue-700

Conversation

@joshjhall

Copy link
Copy Markdown
Owner

Summary

  • Follow-up from feat(v5): cross-compilation and binary distribution for stibbons #286 / PR feat(stibbons): cross-compilation and binary distribution #690 review. The workspace-wide [profile.release]
    block was added purely to keep the shipped stibbons binaries under the 15 MB
    budget, but its size tuning (strip, lto = "thin", codegen-units = 1,
    opt-level = "s") silently applied to every crate's release build.
  • Moved the tuning to a dedicated [profile.dist] (inherits = "release") so
    only the distributed stibbons binaries get it. The default [profile.release]
    returns to Cargo defaults for the CI-only crates (luggage,
    record-evidence, containers-common) — restoring fast release builds and
    debug symbols for binaries that are never distributed.
  • release-binaries.yml now builds with cargo build --profile dist and reads
    artifacts from target/<triple>/dist/ instead of target/<triple>/release/.

A dedicated profile is used rather than a [profile.release.package.stibbons]
override because Cargo per-package overrides cannot express lto (a
profile-root-only setting) — the issue calls this out.

Test plan

  • cargo build --profile dist -p stibbons → 3.5 MB stripped binary in
    target/dist/stibbons, well under the 15 MB gate.
  • just build (default release path) compiles the full workspace.
  • just test → 3143 passed, 0 failed; cargo clippy --workspace and
    cargo fmt --all --check clean.
  • just lint-workflows (actionlint) passes; no lingering
    target/<triple>/release/stibbons references remain in the workflow.

Closes #700

The workspace-wide [profile.release] added in #286/#690 kept the shipped
stibbons binaries under the 15 MB budget, but its size tuning (strip,
lto = "thin", codegen-units = 1, opt-level = "s") silently applied to
every crate's release build — including CI-only binaries (luggage,
record-evidence, containers-common) that are never distributed and that
pay the codegen-units=1 / thin-LTO build-time cost and lose debug symbols
for no benefit.

Move the tuning to a dedicated [profile.dist] (inherits = "release") and
build the distribution binaries with `cargo build --profile dist` in
release-binaries.yml, updating the packaging paths from
target/<triple>/release/ to target/<triple>/dist/. The default release
profile returns to Cargo defaults for the rest of the workspace.

A dedicated profile is used rather than a [profile.release.package.stibbons]
override because Cargo per-package overrides cannot express `lto` (a
profile-root-only setting).

Verified: `cargo build --profile dist -p stibbons` yields a 3.5 MB stripped
binary in target/dist/ (well under the 15 MB gate); just build/test, clippy,
fmt, and actionlint all pass.

Closes #700
@joshjhall joshjhall merged commit 70fd67d into main Jul 5, 2026
16 checks passed
@joshjhall joshjhall deleted the feature/issue-700 branch July 5, 2026 21:46
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.

fix(build): scope [profile.release] to stibbons distribution binaries

2 participants