copy sapling params to OUT_DIR instead of source directory#2320
Open
evanbranigan-dotcom wants to merge 2 commits into
Open
copy sapling params to OUT_DIR instead of source directory#2320evanbranigan-dotcom wants to merge 2 commits into
evanbranigan-dotcom wants to merge 2 commits into
Conversation
The build script copied sapling params to zingolib/zcash-params/ in the source tree, violating cargo's convention of only writing to target/ and ~/.cargo. This broke reproducible builds and caused unnecessary 50MB duplication. Copy to $OUT_DIR/zcash-params/ instead and use rust_embed's interpolate-folder-path feature to resolve the path at compile time. Fixes zingolabs#2315 AI Disclosure: Claude (Anthropic) assisted with codebase analysis and patch authoring. All code was reviewed and understood by the committer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
$OUT_DIR/zcash-params/instead ofzingolib/zcash-params/in the source treerust_embed'sinterpolate-folder-pathfeature to resolve$OUT_DIRat compile timeProblem
The build script wrote sapling params to
zingolib/zcash-params/(in the source tree), violating Cargo's convention of only writing totarget/and~/.cargo. This broke reproducible builds, caused unnecessary duplication, and panicked if the source directory was read-only.Changes
zingolib/build.rs$OUT_DIR/zcash-params/instead of./zcash-params/zingolib/src/lib.rs#[folder = "$OUT_DIR/zcash-params/"](was"zcash-params/")zingolib/Cargo.tomlinterpolate-folder-pathfeature torust-embedTest plan
cargo check -p zingolibpassescargo check -p zingo-clipassescargo clippy -p zingolib -- -D warningspassescargo doc --no-deps -p zingolibpasses (with-D warnings)cargo fmtcleantarget/debug/build/zingolib-*/out/zcash-params/Note: The existing
zingolib/zcash-params/directory (gitignored) can now be deleted. New builds will not write to it.Fixes #2315
AI Disclosure
Claude (Anthropic) assisted with codebase analysis and patch authoring. All code was reviewed and understood by the committer.