Repository navigation
nushell: keep upstream thin LTO, drop codegen-units=1; use packages/detbuild - #1742
Open
bryan-minimal wants to merge 1 commit into
Open
bryan-minimal wants to merge 1 commit into
bryan-minimal wants to merge 1 commit into
Conversation
…/detbuild The recipe turned LTO off and forced codegen-units=1 (RUSTFLAGS and profile) for reproducibility (#254, #292). #292 also added the getrandom shim, which as with codex (#1713) is the part that matters (inbox#253). Keep upstream's release profile, 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>
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
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. View limit details
|
Member
Author
|
Build-bot |
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.
What
For reproducibility, nushell's recipe turned off upstream's thin LTO (
CARGO_PROFILE_RELEASE_LTO=off) and forced codegen-units=1, both in RUSTFLAGS and in the profile (#254, #292). This PR:lto = "thin",opt-level = "s", default codegen units) is used;/tmp/libdetrand.so) withpackages/detbuild, preloaded on the one offlinecargo build --frozen, as codex does (codex: drop codegen-units=1 (reproducible via the entropy shim), strip, link system sqlite/zstd/oniguruma/bzip2, skip the rusty_v8 fetch #1713);symbol-mangling-version=v0,CONST_RANDOM_SEED=0,--remap-path-prefix, the security-floor check, andcargo fetch --lockedbefore the shim are all unchanged.Why
#292 added the getrandom shim in the same change as the LTO-off / cgu=1 overrides. As with codex (#878 to #1713, gominimal/inbox#253), the shim is the part that makes the build reproducible, and the overrides only make it slow.
Build time
Build-bot numbers come from res-server's
wall_s/cpu_lower_bound_sjournal fields. The baseline is main's builds from the last 2 days; this PR's are from run c20be6ea.Reproducibility evidence
I ran two clean local
--rebuilds, each in a freshly activated session (arm64):fa7bd19dc3ec7b31ff64aff85a0c2bee21c97911c29630ff1ed6ffe9b0e83eca, 85,373,520 Bfa7bd19dc3ec7b31ff64aff85a0c2bee21c97911c29630ff1ed6ffe9b0e83eca, 85,373,520 BThe two binaries are byte-identical.
Runtime trade-off
This turns upstream's thin LTO back on, but codegen is now parallel (default units) instead of cgu=1. The artifact is about 8% larger (90 MB vs 83 MB), and the binary may be a few percent slower than with cgu=1. For a shell, that is acceptable.
🤖 Generated with Claude Code