diff --git a/.github/workflows/mirror-noir-subrepo.yml b/.github/workflows/mirror-noir-subrepo.yml index abcae31ac0a..9ca0d61d2ca 100644 --- a/.github/workflows/mirror-noir-subrepo.yml +++ b/.github/workflows/mirror-noir-subrepo.yml @@ -96,6 +96,12 @@ jobs: git config --file="$SUBREPO_PATH/.gitrepo" subrepo.commit "$BASE_NOIR_COMMIT" # make a new commit with our previous message git commit -am "$COMMIT_MESSAGE" + + # There's various changes which we need to make to account for CI differences so we run this script to apply them. + git checkout origin/master -- noir/scripts/sync-out-fixup.sh + noir/scripts/sync-out-fixup.sh + git commit -am "chore: apply sync fixes" + # Now push to it with subrepo with computed commit messages if ./scripts/git-subrepo/lib/git-subrepo push $SUBREPO_PATH --squash --branch=$STAGING_BRANCH; then # We don't push a commit to aztec anymore so that we can maintain the 'commit' as our last pull branch diff --git a/.github/workflows/pull-noir.yml b/.github/workflows/pull-noir.yml index fdd990816c2..b1ca0cc7bbf 100644 --- a/.github/workflows/pull-noir.yml +++ b/.github/workflows/pull-noir.yml @@ -101,8 +101,8 @@ jobs: git commit -am "[$LINES changes] $COMMIT_MESSAGE" # There's various changes which we need to make to account for CI differences so we run this script to apply them. - git checkout origin/master -- noir/scripts/sync-fixup.sh - noir/scripts/sync-fixup.sh + git checkout origin/master -- noir/scripts/sync-in-fixup.sh + noir/scripts/sync-in-fixup.sh git commit -am "chore: apply sync fixes" git push origin $STAGING_BRANCH --force diff --git a/noir/bb-version b/noir/bb-version new file mode 100644 index 00000000000..72a8a6313bb --- /dev/null +++ b/noir/bb-version @@ -0,0 +1 @@ +0.41.0 diff --git a/noir/scripts/sync-fixup.sh b/noir/scripts/sync-in-fixup.sh similarity index 89% rename from noir/scripts/sync-fixup.sh rename to noir/scripts/sync-in-fixup.sh index 1f1152d1cee..ba3c591eac4 100755 --- a/noir/scripts/sync-fixup.sh +++ b/noir/scripts/sync-in-fixup.sh @@ -5,6 +5,8 @@ cd $(dirname $0)/../noir-repo tmp=$(mktemp) BACKEND_BARRETENBERG_PACKAGE_JSON=./tooling/noir_js_backend_barretenberg/package.json + +jq -r '.dependencies."@aztec/bb.js"' $BACKEND_BARRETENBERG_PACKAGE_JSON > ../bb-version jq '.dependencies."@aztec/bb.js" = "portal:../../../../barretenberg/ts"' $BACKEND_BARRETENBERG_PACKAGE_JSON > $tmp && mv $tmp $BACKEND_BARRETENBERG_PACKAGE_JSON # This script runs in CI which enforces immutable installs by default, diff --git a/noir/scripts/sync-out-fixup.sh b/noir/scripts/sync-out-fixup.sh new file mode 100755 index 00000000000..79976883d0b --- /dev/null +++ b/noir/scripts/sync-out-fixup.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -eu + +cd $(dirname $0)/../noir-repo + +BB_VERSION=$(cat ../bb-version) + +tmp=$(mktemp) +BACKEND_BARRETENBERG_PACKAGE_JSON=./tooling/noir_js_backend_barretenberg/package.json +jq --arg v $BB_VERSION '.dependencies."@aztec/bb.js" = $v' $BACKEND_BARRETENBERG_PACKAGE_JSON > $tmp && mv $tmp $BACKEND_BARRETENBERG_PACKAGE_JSON + +# This script runs in CI which enforces immutable installs by default, +# we then must turn this off in order to update yarn.lock. +YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install + +# Add requirement for `wasm-opt` to be installed +sed -i "s/^#require_command wasm-opt/require_command wasm-opt/" ./tooling/noirc_abi_wasm/build.sh +sed -i "s/^#require_command wasm-opt/require_command wasm-opt/" ./acvm-repo/acvm_js/build.sh