diff --git a/noir-projects/bootstrap.sh b/noir-projects/bootstrap.sh index 1de289dfa151..9bd80aeea54a 100755 --- a/noir-projects/bootstrap.sh +++ b/noir-projects/bootstrap.sh @@ -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 diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 8de829b93502..e220700c5cdb 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -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 ::: \ @@ -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