Skip to content

Commit ce6c984

Browse files
committed
fixes
1 parent 766d1db commit ce6c984

4 files changed

Lines changed: 24 additions & 19 deletions

File tree

ci3/release_prep_package_json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ for deps in dependencies devDependencies peerDependencies; do
2222
mv tmp.json package.json
2323
done
2424
done
25+
26+
# Stamp aztec_version into any published noir contract artifacts in artifacts/*.json. The build-time stamp in
27+
# noir-projects/noir-contracts/bootstrap.sh writes "dev"; $version here is the authoritative release version about to
28+
# be written to package.json. We cannot stamp real version in bootstrap because there we don't have access to it.
29+
if [ -d artifacts ]; then
30+
for f in artifacts/*.json; do
31+
[ -e "$f" ] || continue
32+
jq --arg v "$version" '.aztec_version = $v' "$f" >$tmp && mv $tmp "$f"
33+
done
34+
fi

noir-projects/noir-contracts/bootstrap.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,16 @@ function get_contract_path {
9393
}
9494
export -f get_contract_path
9595

96-
# Stamps the aztec version into a contract artifact JSON in place. Mirrors stampAztecVersion in
97-
# yarn-project/aztec/src/cli/cmds/compile.ts so monorepo-built artifacts match those produced by `aztec compile`.
98-
# On release builds (REF_NAME is valid semver) the tag without the leading "v" is used; otherwise "dev".
99-
function stamp_aztec_version {
96+
# Stamps "dev" (DEV_VERSION) as the artifact's aztec_version - that is the expected version of a locally checked out
97+
# monorepo. The real release version is applied at publish time by whichever path owns it:
98+
# ci3/release_prep_package_json for npm packages, release-image/Dockerfile for the docker image.
99+
function stamp_dev_aztec_version {
100100
local json_path=$1
101-
# "dev" here corresponds to DEV_VERSION in yarn-project/stdlib/src/update-checker/dev_version.ts.
102-
local version="dev"
103-
semver check "$REF_NAME" 2>/dev/null && version="${REF_NAME#v}"
104101
local tmp=$(mktemp)
105-
jq --arg v "$version" '.aztec_version = $v' "$json_path" > "$tmp"
102+
jq '.aztec_version = "dev"' "$json_path" > "$tmp"
106103
mv "$tmp" "$json_path"
107104
}
108-
export -f stamp_aztec_version
105+
export -f stamp_dev_aztec_version
109106

110107
# This compiles a noir contract, transpiles public functions, strips internal prefixes,
111108
# and generates verification keys for private functions via 'bb aztec_process'.
@@ -127,9 +124,9 @@ function compile {
127124
$BB aztec_process -i $json_path
128125
cache_upload contract-$contract_hash.tar.gz $json_path
129126
fi
130-
# Stamp the current version after the cache block so the field always matches the build's version, whether
131-
# the artifact came from a fresh compile or a cache hit.
132-
stamp_aztec_version "$json_path"
127+
# Stamp the version after the cache block so the field is always present, whether the artifact came from a fresh
128+
# compile or a cache hit.
129+
stamp_dev_aztec_version "$json_path"
133130
}
134131
export -f compile
135132

release-image/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ WORKDIR "/usr/src/yarn-project"
1919
ARG VERSION
2020
RUN echo '{".": "'$VERSION'"}' > /usr/src/.release-please-manifest.json
2121

22-
# Re-stamp aztec_version in published contract artifacts. Mirrors stamp_aztec_version() in
23-
# noir-projects/noir-contracts/bootstrap.sh and stampAztecVersion() in
24-
# yarn-project/aztec/src/cli/cmds/compile.ts. Needed because artifacts are compiled in an earlier
25-
# build stage where REF_NAME isn't set, leaving them with aztec_version: "dev".
22+
# Stamp aztec_version into the shipped contract artifacts. The build-time stamp in
23+
# noir-projects/noir-contracts/bootstrap.sh writes "dev" unconditionally; $VERSION here is the authoritative release
24+
# version for this image.
2625
RUN for dir in \
2726
/usr/src/yarn-project/accounts/artifacts \
2827
/usr/src/yarn-project/noir-contracts.js/artifacts \

yarn-project/end-to-end/src/fixtures/setup.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,8 @@ function assertContractArtifactsVersion() {
284284
);
285285
return;
286286
}
287-
// TODO(F-557): Remove once v4.3.0 drops off the compat matrix. The v4.3.0 release shipped with
288-
// aztec_version: "dev" baked into the published artifact JSONs because release-image/Dockerfile
289-
// did not re-stamp them. Fixed for future releases by the artifact restamp step in that Dockerfile.
287+
// TODO(F-557): Remove once v4.3.0 drops off the compat matrix. The v4.3.0 npm release shipped with
288+
// aztec_version: "dev" baked into the artifact JSONs because of a bug.
290289
if (expected === '4.3.0' && aztecVersion === DEV_VERSION) {
291290
createLogger('e2e:setup').warn(
292291
`Skipping artifact version check: v4.3.0 artifacts shipped with aztec_version="dev"`,

0 commit comments

Comments
 (0)