-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Support workspaces and package selection on every nargo command #1992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lines up with a lot of my thinking on workspaces from looking at how Cargo handles them. I've made a couple of notes but I don't think that they'll be anything you don't already know. Don't want to raise too many nits while this is draft so let me know when you make this PR ready for review.
cd11b28
to
b18483f
Compare
4963946
to
3e58f37
Compare
48028aa
to
6e9ac11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting collisions due to not namespacing proofs/witnesses/etc. I've updated the integration tests to ensure that the workspace packages are distinct so we get test failures.
I'd be ok with just restricting prove/verify/execute to run on a single package and error if no default is set. |
I think we should prefix the package name as a directory, or use the package name as the proof name by default. |
* master: feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077) chore: clippy fixes (#2101)
* master: (50 commits) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119) feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077) chore: clippy fixes (#2101) chore: Update `noir-source-resolver` to v1.1.3 (#1912) chore: Document `GeneratedAcir::more_than_eq_comparison` (#2085) ...
* master: chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119) feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077)
* master: chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119) feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077)
Description
Problem*
Closes #794
Closes #1201 (we might want a follow-up issue for the caching vs rebuilding a package)
Towards #1838
Summary*
This replaces the originally merged workspace logic by unifying the various ways you can configure a project (top-level package, workspace, etc) into a single
Workspace
type that can contain one of morePackage
and optionally a selectedPackage
. It also separates these concepts from the serde logic when parsing toml and adds functions that resolve aWorkspace
completely. It adds an iterator implementation onWorkspace
that iterates the correctPackage
s where each package can be prepared with it's own Context so we don't leak any compilation details.Note: This PR is breaking as it removes
circuit_name
,proof_name
andproof
positional arguments for various commands and replaces them with--package
CLI argument. This means that each Package is expected to contain exactly one "named circuit" and users will be expected to setup a workspace to achieve the old behavior.Below is a diagram of the pipeline between Nargo.toml files, the
--package
CLI flag, andWorkspace
struct.Documentation
This PR requires documentation updates when merged.
We need to update each command that now accepts the
--package
argument, remove thecircuit_name
positional argument, and we need to document workspaces thoroughly.Additional Context
PR Checklist*
cargo fmt
on default settings.