fix: handle workspace members in needsRecompile crate collection#21284
fix: handle workspace members in needsRecompile crate collection#21284benesjan merged 2 commits intomerge-train/fairiesfrom
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
nchamo
left a comment
There was a problem hiding this comment.
Have a small question about members + dependencies and if they can co-exist
|
|
||
| const members = (parsed.workspace as Record<string, any>)?.members as string[] | undefined; | ||
|
|
||
| if (Array.isArray(members)) { |
There was a problem hiding this comment.
Just curious. Is it possible for a workspace root to have both members and dependencies? If not, could we clarify that in a comment?
There was a problem hiding this comment.
Workspace is a collection of crates and doesn't have its own source code.
I don't think this is the place to explain what is noir workspace.
There was a problem hiding this comment.
Why not? In this code you are assuming that the toml file either has members or dependencies. I'm not saying that you should write a full explanation of how Noir workspaces work, but a one line doc that explains that this is the actual behavior would benefit people not yet familiar with Noir
But feel free to ignore
| const testToml = `[package] | ||
| name = "test_test" | ||
| type = "lib" | ||
|
|
||
| [dependencies] | ||
| aztec = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "v5.0.0" } | ||
| ext = { path = "../external_lib" } | ||
| test_contract = { path = "../test_contract" } | ||
| `; |
There was a problem hiding this comment.
Can we make it easier to read like this? And we could do the same with the other definitions above and below
| const testToml = `[package] | |
| name = "test_test" | |
| type = "lib" | |
| [dependencies] | |
| aztec = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "v5.0.0" } | |
| ext = { path = "../external_lib" } | |
| test_contract = { path = "../test_contract" } | |
| `; | |
| const testToml = ` | |
| [package] | |
| name = "test_test" | |
| type = "lib" | |
| [dependencies] | |
| aztec = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "v5.0.0" } | |
| ext = { path = "../external_lib" } | |
| test_contract = { path = "../test_contract" } | |
| `; |
There was a problem hiding this comment.
Then the resulting Nargo.toml would start with a new line. I don't think this matters much as it's already not hard to read.
When a Nargo.toml defines a [workspace] with members, collectCrateDirs now visits each member directory and follows their path-based dependencies. Previously only the root Nargo.toml's [dependencies] were checked, which meant workspace member deps were never discovered and source changes in them would not trigger recompilation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Nicolas Chamo <nicolas@chamo.com.ar>
1ecd98d to
e79fc61
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BEGIN_COMMIT_OVERRIDE fix: skip oracle version check for pinned protocol contracts (#21349) fix: not reusing tags of partially reverted txs (#20817) feat: move storage_slot from partial commitment to completion hash (#21351) feat: offchain reception (#20893) fix: handle workspace members in needsRecompile crate collection (#21284) fix(aztec-nr): return Option from decode functions and fix event commitment capacity (#21264) fix: handle bad note lengths on compute_note_hash_and_nullifier (#21271) fix: address review feedback from PRs #21284 and #21237 (#21369) fix: claim contract & improve nullif docs (#21234) feat!: auto-enqueue public init nullifier for contracts with public functions (#20775) fix: search for all note nonces instead of just the one for the note index (#21438) fix: set anvilSlotsInAnEpoch in e2e_offchain_payment to prevent finalization race (#21452) fix: complete legacy oracle mappings for all pinned contracts (#21404) fix: correct inverted constrained encryption check in message delivery (#21399) feat!: improve L2ToL1MessageWitness API (#21231) END_COMMIT_OVERRIDE

Summary
collectCrateDirsto handle Nargo workspace roots (those with[workspace]andmembersdefined)Nargo.tomlwas a workspace, its member crates were never visited, so path-based dependencies declared in member crates were not tracked for recompilationTest plan
traverses workspace members and their path dependenciesadded and passingneedsRecompiletests continue to pass (15/15)🤖 Generated with Claude Code