Skip to content

Commit d21cd39

Browse files
authored
fix: noir-protocol circuits (AztecProtocol#3734)
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 🤞
1 parent f19996e commit d21cd39

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/mirror_repos.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,30 @@ jobs:
7676
# list all aztec-packages tags, take the "highest" version
7777
monorepo_tag="$(git tag --list aztec-packages-v* | sort --version-sort | tail -1)"
7878
monorepo_protocol_circuits_path="yarn-project/noir-protocol-circuits"
79-
nargo_file="$SUBREPO_PATH/aztec/Nargo.toml"
79+
80+
# take all Nargo.toml files that reference noir-protocol-circuits
81+
nargo_files="$(find $SUBREPO_PATH -name 'Nargo.toml' | xargs grep --files-with-matches 'noir-protocol-circuits')"
8082
8183
# match lines like this:
8284
# protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }
8385
# and replace with
8486
# protocol_types = { git="https://github.com/aztecprotocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="yarn-project/noir-protocol-circuits/src/crates/types" }
85-
sed --regexp-extended --in-place \
86-
"s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \
87-
$nargo_file
87+
for nargo_file in $nargo_files; do
88+
sed --regexp-extended --in-place \
89+
"s;path\s*=\s*\".*noir-protocol-circuits(.*)\";git=\"$monorepo_url\", tag=\"$monorepo_tag\", directory=\"$monorepo_protocol_circuits_path\1\";" \
90+
$nargo_file
91+
done
8892
8993
git commit --all --message "chore: replace relative paths to noir-protocol-circuits"
9094
9195
if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=master; then
9296
git fetch # in case a commit came after this
9397
git rebase origin/master
9498
95-
# restore old Nargo.toml
96-
# We have to go back two generations. History looks like this:
97-
# HEAD <--- the commit generated by git_subrepo
98-
# HEAD~1 <--- the chore commit created above
99-
# HEAD~2 <--- the original commit we were supposed to mirror or the tip of master after rebase
100-
git restore --source=HEAD~2 -- $nargo_file
99+
# restore old files
100+
for nargo_file in $nargo_files; do
101+
git restore --source=origin/master -- $nargo_file
102+
done
101103
git commit --all --amend -m "$(git log -1 --pretty=%B) [skip ci]"
102104
103105
git push

yarn-project/aztec-nr/aztec/Nargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ compiler_version = ">=0.18.0"
55
type = "lib"
66

77
[dependencies]
8-
protocol_types = { git="https://github.com/AztecProtocol/aztec-packages", tag="aztec-packages-v0.16.9", directory="yarn-project/noir-protocol-circuits/src/crates/types" }
8+
protocol_types = { path = "../../noir-protocol-circuits/src/crates/types" }

0 commit comments

Comments
 (0)