chore: Remove Noir builtin comptime mutable methods from macros#21801
Conversation
|
Given this error in the CI run: Is this waiting for a new Noir to be synced to the repo? |
|
d35a1a0 to
e4af615
Compare
ecbc340 to
d094299
Compare
|
@critesjosh @sklppy88 do you know why the docs deploy may be failing here? |
|
Another bad squash. Embarrassing. Apologies for the extra review requests. This PR should be ready to go now - unsure why docs seem to be using old noir versions without the new methods added in #21566. |
|
i updated the branch to see if it resolves the docs failure |
|
it looks like netlify (where our docs are hosted and built) does not compile noir from source, it downloads a nightly binary using noirup and its not getting the right one. im looking into it |
|
I just cleared the netlify cache and rebuilt and it looks like its working |
09a33ad to
831281a
Compare
|
Failed to reproduce the failure of Will try to re-run and then bother someone with it |
Remake of #21321 since that PR got messed up from a bad merge. The following functions will be removed from Noir: ```rs FunctionDefinition::add_attribute FunctionDefinition::set_body FunctionDefinition::set_parameters FunctionDefinition::set_return_type FunctionDefinition::set_return_public FunctionDefinition::set_return_data FunctionDefinition::set_unconstrained Module::add_item TypeDefinition::add_attribute TypeDefinition::add_generic TypeDefinition::set_fields ``` Only being replaced by the new functions `FunctionDefinition::disable` and `TypeDefinition::add_abi` which were the minimal set of functions determined to be needed here so that the Noir team can remove as many of the old mutating functions as possible. Since the original PR, a call to `f.add_attribute("noinitcheck")` has been added. I've replaced this with an explicit call to `noinitcheck(f)` and adding `f` to a global list of functions that should be considered to have a noinitcheck attribute to keep the check for that attribute working. Co-authored-by: benesjan <benesjan@users.noreply.github.com>
41db394 to
a252184
Compare
|
❌ Failed to cherry-pick to |
…ds from macros) Cherry-pick of 5de59a7 — replaces deprecated Noir comptime APIs: - add_attribute('abi(events)') -> add_abi('events') - set_body/set_parameters/add_attribute/set_return_public -> function.disable() - fn_has_noinitcheck now also checks is_fn_only_self() - Removes f.add_attribute('noinitcheck') from only_self
…#22485) ## Summary Backport of #22393 (Update Noir to nightly-2026-04-10) to v4-next, plus 3 companion PRs needed for Noir compatibility since v4-next was still on nightly-2026-02-12. ## Companion PRs included Since v4-next hadn't updated Noir since nightly-2026-02-12 (~2 months behind), several intermediate Noir-adaptation PRs were also needed: 1. **#20702** — Remove unnecessary `comptime` qualifier from VK tree constants (Noir broke comptime globals used in non-comptime contexts) 2. **#20798** — Remove unnecessary `let mut` across noir-projects (newer Noir errors on this) 3. **#21801** — Replace deprecated Noir comptime APIs: `add_attribute()` → `add_abi()`, `set_body()`/`set_parameters()`/`set_return_public()` → `function.disable()`, update `fn_has_noinitcheck` to also check `is_fn_only_self()` ## Commits 1. **Cherry-pick with conflict markers** — raw cherry-pick of #22393 2. **Conflict resolution** — version bumps + reformatting resolved 3. **Cherry-pick #20702** — comptime globals + poseidon2 hash fix 4. **Cherry-pick #20798** — unnecessary mut removal (24 files) 5. **Cherry-pick #21801** — macro API migration (4 files) 6. **Remaining fixes** — private_context.nr mut + utils.nr style alignment
…tlify (#21919) ## Summary - Makes the Netlify preview build continue when aztec-nr API doc generation fails, instead of aborting the entire deploy - Fixes the issue seen in #21801 where the preview deploy fails because the downloaded nargo nightly binary lacks new comptime APIs (`FunctionDefinition::disable`, `TypeDefinition::add_abi`) that the aztec-nr code uses ## Context The Netlify preview build downloads a pre-built nargo binary via `noirup`. When the noir submodule in aztec-packages is ahead of the latest published nightly, `nargo doc` can fail because the binary doesn't have APIs that aztec-nr's macros depend on. This blocks the entire preview deploy even though the API docs are non-essential for PR review. With this change, the build logs a warning and continues without API docs rather than failing entirely. ## Test plan - [ ] Verify Netlify preview deploys successfully even when nargo version is incompatible - [ ] Verify API docs still generate normally when nargo version is compatible
Remake of #21321 since that PR got messed up from a bad merge.
The following functions will be removed from Noir:
Only being replaced by the new functions
FunctionDefinition::disableandTypeDefinition::add_abiwhich were the minimal set of functions determined to be needed here so that the Noir team can remove as many of the old mutating functions as possible.Since the original PR, a call to
f.add_attribute("noinitcheck")has been added. I've replaced this with an explicit call tonoinitcheck(f)and addingfto a global list of functions that should be considered to have a noinitcheck attribute to keep the check for that attribute working.