Skip to content

Commit

Permalink
chore: automate necessary changes to outward sync into noir-lang/noir (
Browse files Browse the repository at this point in the history
…#7049)

This PR automates syncs out to noir-lang/noir similarly to how it was
done for inward syncs.

The main difference is that we need to save the version of `bb` which
noir-lang/noir is using so we can restore it on any outward sync. We
then save the version of bb.js last seen on every inbound sync into the
`bb-version` file and reapply it on outbound syncs.
  • Loading branch information
TomAFrench authored Jun 17, 2024
1 parent a23fd0b commit 449e41c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/mirror-noir-subrepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-noir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions noir/bb-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.41.0
2 changes: 2 additions & 0 deletions noir/scripts/sync-fixup.sh → noir/scripts/sync-in-fixup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 18 additions & 0 deletions noir/scripts/sync-out-fixup.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 449e41c

Please sign in to comment.