@@ -152,9 +152,12 @@ function build {
152152 # If pinned-build.tar.gz exists, use it instead of compiling.
153153 if [ -f pinned-build.tar.gz ]; then
154154 echo_stderr " Using pinned-build.tar.gz instead of compiling."
155+ # The archive holds project-root-relative paths (target/ plus the reset-circuit variant
156+ # manifest, which generate_variants would normally produce but is skipped here), so it
157+ # unpacks straight into place: target/ and private_kernel_reset_dimensions.json land where
158+ # downstream codegen (noir-protocol-circuits-types) expects them.
155159 rm -rf target
156- mkdir -p target
157- tar xzf pinned-build.tar.gz -C target
160+ tar xzf pinned-build.tar.gz
158161 return
159162 fi
160163
@@ -257,7 +260,14 @@ function pin-build {
257260 rm -f pinned-build.tar.gz
258261 build
259262 echo_stderr " Creating pinned-build.tar.gz from target..."
260- tar czf pinned-build.tar.gz -C target .
263+ # Archive project-root-relative paths so the build can unpack straight into place. We bundle
264+ # the reset-circuit variant manifest alongside target/ because generate_variants (which
265+ # produces it) is skipped when a pinned build is consumed, yet downstream codegen
266+ # (noir-protocol-circuits-types) requires it. The manifest only exists for the real circuits,
267+ # so it is included conditionally (mock-protocol-circuits has none).
268+ pin_paths=(target)
269+ [ -f private_kernel_reset_dimensions.json ] && pin_paths+=(private_kernel_reset_dimensions.json)
270+ tar czf pinned-build.tar.gz " ${pin_paths[@]} "
261271 echo_stderr " Done. pinned-build.tar.gz created. Commit it to pin these artifacts."
262272}
263273
0 commit comments