Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions noir-projects/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ function format {
parallel -k ./{}/bootstrap.sh format ::: noir-protocol-circuits noir-contracts aztec-nr
}

function pin-build {
echo_header "noir-projects pin-build"
parallel --tag --line-buffered --halt now,fail=1 './{}/bootstrap.sh pin-build' ::: \
mock-protocol-circuits \
noir-protocol-circuits
}

case "$cmd" in
"")
build
Expand Down
18 changes: 18 additions & 0 deletions noir-projects/noir-protocol-circuits/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ export -f hex_to_fields_json compile
function build {
set -eu

# If pinned-build.tar.gz exists, use it instead of compiling.
if [ -f pinned-build.tar.gz ]; then
echo_stderr "Using pinned-build.tar.gz instead of compiling."
rm -rf target
mkdir -p target
tar xzf pinned-build.tar.gz -C target
return
fi

if [[ -z NOIR_PROTOCOL_CIRCUITS_SKIP_CHECK_WARNINGS ]]; then
echo_stderr "Checking libraries for warnings..."
parallel -v --line-buffer --tag $NARGO --program-dir {} check ::: \
Expand Down Expand Up @@ -244,6 +253,15 @@ function bench {
bench_cmds | STRICT_SCHEDULING=1 parallelize
}

function pin-build {
# Force a real build by removing any existing pinned archive.
rm -f pinned-build.tar.gz
build
echo_stderr "Creating pinned-build.tar.gz from target..."
tar czf pinned-build.tar.gz -C target .
echo_stderr "Done. pinned-build.tar.gz created. Commit it to pin these artifacts."
}

case "$cmd" in
"clean-keys")
rm -rf $key_dir
Expand Down
Loading