From 3fe955c50e55ab342e8c2c849c0879bc206c99e3 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Tue, 19 Dec 2023 09:09:23 +0000 Subject: [PATCH] fix: noir-protocol circuits (#3734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this PR restores the relative path to noir-protocol-circuits in `aztec-nr/aztec/Nargo.toml` and makes the path remapping more generic and robust 🤞 --- .github/workflows/mirror_repos.yml | 22 ++++++++++++---------- yarn-project/aztec-nr/aztec/Nargo.toml | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/mirror_repos.yml b/.github/workflows/mirror_repos.yml index d29078c98cd..aeac37b85c2 100644 --- a/.github/workflows/mirror_repos.yml +++ b/.github/workflows/mirror_repos.yml @@ -76,15 +76,19 @@ jobs: # list all aztec-packages tags, take the "highest" version monorepo_tag="$(git tag --list aztec-packages-v* | sort --version-sort | tail -1)" monorepo_protocol_circuits_path="yarn-project/noir-protocol-circuits" - nargo_file="$SUBREPO_PATH/aztec/Nargo.toml" + + # take all Nargo.toml files that reference noir-protocol-circuits + nargo_files="$(find $SUBREPO_PATH -name 'Nargo.toml' | xargs grep --files-with-matches 'noir-protocol-circuits')" # match lines like this: # protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" } # and replace with # protocol_types = { git="https://github.com/aztecprotocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="yarn-project/noir-protocol-circuits/src/crates/types" } - sed --regexp-extended --in-place \ - "s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \ - $nargo_file + for nargo_file in $nargo_files; do + sed --regexp-extended --in-place \ + "s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \ + $nargo_file + done git commit --all --message "chore: replace relative paths to noir-protocol-circuits" @@ -92,12 +96,10 @@ jobs: git fetch # in case a commit came after this git rebase origin/master - # restore old Nargo.toml - # We have to go back two generations. History looks like this: - # HEAD <--- the commit generated by git_subrepo - # HEAD~1 <--- the chore commit created above - # HEAD~2 <--- the original commit we were supposed to mirror or the tip of master after rebase - git restore --source=HEAD~2 -- $nargo_file + # restore old files + for nargo_file in $nargo_files; do + git restore --source=origin/master -- $nargo_file + done git commit --all --amend -m "$(git log -1 --pretty=%B) [skip ci]" git push diff --git a/yarn-project/aztec-nr/aztec/Nargo.toml b/yarn-project/aztec-nr/aztec/Nargo.toml index 392d7dca8da..fb8ba9b6fd4 100644 --- a/yarn-project/aztec-nr/aztec/Nargo.toml +++ b/yarn-project/aztec-nr/aztec/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = ">=0.18.0" type = "lib" [dependencies] -protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="yarn-project/noir-protocol-circuits/src/crates/types" } \ No newline at end of file +protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }