chore: backport aztec CLI improvements to v4-next#22587
Merged
benesjan merged 7 commits intobackport-to-v4-next-stagingfrom Apr 16, 2026
Merged
chore: backport aztec CLI improvements to v4-next#22587benesjan merged 7 commits intobackport-to-v4-next-stagingfrom
benesjan merged 7 commits intobackport-to-v4-next-stagingfrom
Conversation
In this PR I ensure that contracts get automatically recompiled when `aztec test` is run. To avoid unnecessary compilations I use `make` command inspired approach of checking timestamp of source files (*.toml and *.nr files) against the timestamp of the oldest artifact in the `/target` dir (as artifact I consider any `*.json` file). **Note:** By using the oldest timestamp we would get constant recompilation on each run in case the dev placed there some random `*.json` file. **Question**: Does the reviewer think this ^ is fine? Alternatively I could nuke the `target` dir whenever a recompilation is being run. This feels a bit dangerous though. Another approach would be to predict the artifact name of individual crates and just check against those. This would be the most efficient but it introduces complexity and brittleness in case `nargo` artifact names change. I think I would keep it as it is for now and come up with solution if someone complains about constant recompilations. I initially thought I will implement this in the `aztec test` command but that command is fully implemented in bash. When I had AI implement this the resulting bash was impossible to comprehend so I told it to rewrite in typescript. Given that the `aztec test` command is calling `aztec compile` that is implemented in typescript it made sense for this PR to modify only that command. This has the added advantage that it will make bugs in this code way more visible because when a dev runs `aztec compile` they will either see that the code is getting re-compiled or they will get "No source changes detected, skipping compilation." log. If they modify a contract, run `aztec compile` and see that nothing got compiled it will be obvious that the thing is broken. Closes https://linear.app/aztec-labs/issue/F-197/auto-recompile-contracts-on-tests --------- Co-authored-by: benesjan <benesjan@users.noreply.github.com> Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
In this PR I add a check that makes `aztec compile` throw an error in case the compile crate or any of its dependencies do not match the version of the `aztec` command. We are currently just checking for version equality instead of doing a more sophisticated semver checks as we are not tracking the versions reliably now. Proper semver checks are likely to be introduced in the future when we track `Aztec.nr` versioning separately from `aztec-packages`. Since I need to check versions not only of local path based dependencies but also of the remote git based deps the approach I use here is that I check if the dep is in the relevant nargo dir, if not I fetch it there, and then I perform the check on that dep there. This means that I re-implement some `nargo` functionality here. Closes https://linear.app/aztec-labs/issue/F-288/make-aztec-compile-warn-of-oldincompatible-aztec-deps-from-nargotoml
- Migration notes for aztec new/init changes moved from 4.1.0-rc.2 to TBD since these are new unreleased changes for v4-next - Restored #include_code run_recursion macro in recursive_verification.md instead of inlined code to keep docs in sync with source
benesjan
commented
Apr 16, 2026
| } | ||
| ``` | ||
|
|
||
| ### `aztec new` crate directories are now named after the contract |
Contributor
Author
There was a problem hiding this comment.
These has gotten here due to incorrect backporting of these changes in #21064
Moved them to the TBD section
benesjan
commented
Apr 16, 2026
Contributor
Author
benesjan
left a comment
There was a problem hiding this comment.
Diff looks good so I am merging this
This was referenced Apr 16, 2026
Thunkar
added a commit
that referenced
this pull request
Apr 17, 2026
BEGIN_COMMIT_OVERRIDE fix(pxe): cap event filter toBlock to last synced block (#22573) fix(pxe): round tx expiration timestamp to reduce precision (#22577) fix: eliminate anvil watcher warp race and false success logs (#22584) refactor: aztec new and init creating 2 crates (#20681) test: aztec new scaffold works (#20711) feat(cli): warning if contract crate has tests (#20723) feat(cli): auto-recompiling when aztec test is run (#20729) feat: aztec new supporting multiple contract crates (#21007) feat: asserts that aztec dep version matches cli (#21245) chore: backport aztec CLI improvements to v4-next (#22587) feat: check noir release has nargo binaries before releasing (#22551) chore: cache chainInfo in embeddedwallet (#22592) fix: wrap external getCapsule in transactionAsync (#22595) fix(pxe): throw clear error for invalid comparator in pick_notes (#22585) refactor(aztec-nr): rename conversion fns to encode_/decode_ naming (#22576) feat: infrastructure for testing `[new_contract_artfiacts, old_aztec_stack]` (#22593) chore: fix unnecessary and inconsistent side-effect counter increments (#22245) fix: update FaceID wallet redirects and strip anchors in redirect validation (#22505) docs: add getting started on testnet guide (#22366) docs: add getting started on testnet guide (backport #22366) (#22619) feat(aztec-nr): new BoundedVec emit private log APIs (#22064) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports 6 PRs with aztec CLI improvements from
nexttov4-next:Test plan