Skip to content

zola: drop codegen-units=1 and fat LTO; use packages/detbuild - #1741

Open
bryan-minimal wants to merge 1 commit into
mainfrom
zola-build-speed
Open

bryan-minimal wants to merge 1 commit into
mainfrom
zola-build-speed

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

zola's build ran on one core. RUSTFLAGS forced -C codegen-units=1 on every crate, and upstream's [profile.release] is lto = true (fat) with codegen-units = 1. This PR:

Why

#525 added cgu=1 together with the entropy shim. As with codex (#878 to #1713), the shim is the part that makes the build reproducible, and cgu=1 only makes it slow.

Build time

before (main) this PR
build-bot arm64 wall / CPU 320–380 s / 640–920 s 82 s / 1071 s
build-bot amd64 wall / CPU 512–621 s / 1290–1700 s 79 s / 1644 s
build-bot artifact bytes ~56–57 MB 67 MB
local min box (6 CPU), two runs - 159 s, 140 s

Build-bot numbers come from res-server's wall_s / cpu_lower_bound_s journal fields. The baseline is main's builds from the last 2 days; this PR's are from run 3851d270.

Reproducibility evidence

I ran two clean local --rebuilds, each in a freshly activated session (arm64):

  • run 1: 267f49f43db5140425f5788712a1dec14d524d95f9476429fa4e5e8ee3d682c3, 52,862,648 B
  • run 2: 267f49f43db5140425f5788712a1dec14d524d95f9476429fa4e5e8ee3d682c3, 52,862,648 B

The two binaries are byte-identical.

Every other reproducibility setting is unchanged: --remap-path-prefix (source dir and cargo home), symbol-mangling-version=v0, CARGO_INCREMENTAL=0, upstream strip = true.

Runtime trade-off

Fat LTO with cgu=1 usually gives a binary a few percent faster than thin LTO over 16 units. For a static-site CLI, that is worth less than a build several times faster, so this PR accepts it, as #1713 did for codex.

🤖 Generated with Claude Code

The cgu=1 RUSTFLAGS and upstream's fat-LTO / cgu=1 release profile ran the
build on one core. #525 added cgu=1 together with the getrandom shim; as with
codex (#1713) the shim is what makes it reproducible. Build at thin LTO over
16 units, and replace the inline shim with packages/detbuild. build.sh echoes
the binary's sha256 so two builds can be compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 48 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 59 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f44b00d and dbc2708.

Files selected for processing: 2

  • packages/zola/build.ncl
  • packages/zola/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal

Copy link
Copy Markdown
Member Author

Build-bot minimal build green (run 3851d270): wall arm64 82 s (was 320–380 s), amd64 79 s (was 512–621 s). Local double build sha256 267f49f4…682c3 both runs (52,862,648 B), byte-identical.

@bryan-minimal
bryan-minimal marked this pull request as ready for review November 26, 2026 22:07
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 26, 2026 22:07
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