From f09752d54a655fd02649e02923a3c9414dc6e20e Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Tue, 19 Dec 2023 10:02:17 +0200 Subject: [PATCH 1/3] fix: restore relative path to protocol types --- yarn-project/aztec-nr/aztec/Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From 6bc740ef9971f4dca76706b5c44fcabf37115f3d Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Tue, 19 Dec 2023 10:03:46 +0200 Subject: [PATCH 2/3] fix: restore Nargo.toml from master branch --- .github/workflows/mirror_repos.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/mirror_repos.yml b/.github/workflows/mirror_repos.yml index d29078c98cd..a83c2e9a983 100644 --- a/.github/workflows/mirror_repos.yml +++ b/.github/workflows/mirror_repos.yml @@ -93,11 +93,7 @@ jobs: 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 + git restore --source=origin/master -- $nargo_file git commit --all --amend -m "$(git log -1 --pretty=%B) [skip ci]" git push From 555042b294fb9d3758076a368b0a8b8688327195 Mon Sep 17 00:00:00 2001 From: alexghr Date: Tue, 19 Dec 2023 08:35:09 +0000 Subject: [PATCH 3/3] fix: generalise aztec-nr path remapping --- .github/workflows/mirror_repos.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mirror_repos.yml b/.github/workflows/mirror_repos.yml index a83c2e9a983..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,8 +96,10 @@ jobs: git fetch # in case a commit came after this git rebase origin/master - # restore old Nargo.toml - git restore --source=origin/master -- $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