-
Notifications
You must be signed in to change notification settings - Fork 374
feat!: Support workspaces and package selection on every nargo command #1992
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6e9ac11
feat!: Support workspaces and package selection on every nargo command
phated 89fabf2
add package name to contract directory
phated eb67fba
print package name at the beginning of any stdout messages
phated d63fe97
Remove circuit_name from compile command and use package name
phated e39d041
remove resolve_workspace_in_directory
phated 4cec2dc
avoid resolving dependencies as a Workspace struct by always requirin…
phated 3273892
chore: ensure workspace packages are distinct
TomAFrench 4638343
Update crates/nargo_cli/src/git.rs
TomAFrench 450b450
remove proof name argument and use package name, remove stdout printi…
phated e0ffb48
fix tests
phated 15309af
rename functions to be more descriptive
phated e2c48ab
add issue number to todo
phated 2900ead
Merge branch 'master' into phated/normalize-workspace
phated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
18 changes: 9 additions & 9 deletions
18
crates/nargo_cli/src/constants.rs → crates/nargo/src/constants.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| // Directories | ||
| /// The directory for the `nargo contract` command output | ||
| pub(crate) const CONTRACT_DIR: &str = "contract"; | ||
| pub const CONTRACT_DIR: &str = "contract"; | ||
| /// The directory to store serialized circuit proofs. | ||
| pub(crate) const PROOFS_DIR: &str = "proofs"; | ||
| pub const PROOFS_DIR: &str = "proofs"; | ||
| /// The directory to store Noir source files | ||
| pub(crate) const SRC_DIR: &str = "src"; | ||
| pub const SRC_DIR: &str = "src"; | ||
| /// The directory to store circuits' serialized ACIR representations. | ||
| pub(crate) const TARGET_DIR: &str = "target"; | ||
| pub const TARGET_DIR: &str = "target"; | ||
|
|
||
| // Files | ||
| /// The file from which Nargo pulls prover inputs | ||
| pub(crate) const PROVER_INPUT_FILE: &str = "Prover"; | ||
| pub const PROVER_INPUT_FILE: &str = "Prover"; | ||
| /// The file from which Nargo pulls verifier inputs | ||
| pub(crate) const VERIFIER_INPUT_FILE: &str = "Verifier"; | ||
| pub const VERIFIER_INPUT_FILE: &str = "Verifier"; | ||
| /// The package definition file for a Noir project. | ||
| pub(crate) const PKG_FILE: &str = "Nargo.toml"; | ||
| pub const PKG_FILE: &str = "Nargo.toml"; | ||
|
|
||
| // Extensions | ||
| /// The extension for files containing circuit proofs. | ||
| pub(crate) const PROOF_EXT: &str = "proof"; | ||
| pub const PROOF_EXT: &str = "proof"; | ||
| /// The extension for files containing proof witnesses. | ||
| pub(crate) const WITNESS_EXT: &str = "tr"; | ||
| pub const WITNESS_EXT: &str = "tr"; | ||
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| use std::{collections::BTreeMap, path::PathBuf}; | ||
|
|
||
| use noirc_frontend::graph::{CrateName, CrateType}; | ||
|
|
||
| use crate::constants::{PROVER_INPUT_FILE, VERIFIER_INPUT_FILE}; | ||
|
|
||
| #[derive(Clone)] | ||
| pub enum Dependency { | ||
| Local { package: Package }, | ||
| Remote { package: Package }, | ||
phated marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| #[derive(Clone)] | ||
| pub struct Package { | ||
| pub root_dir: PathBuf, | ||
| pub crate_type: CrateType, | ||
| pub entry_path: PathBuf, | ||
| pub name: CrateName, | ||
| pub dependencies: BTreeMap<CrateName, Dependency>, | ||
| } | ||
|
|
||
| impl Package { | ||
| pub fn prover_input_path(&self) -> PathBuf { | ||
| // TODO: This should be configurable, such as if we are looking for .json or .toml or custom paths | ||
| // For now it is hard-coded to be toml. | ||
| self.root_dir.join(format!("{PROVER_INPUT_FILE}.toml")) | ||
| } | ||
| pub fn verifier_input_path(&self) -> PathBuf { | ||
| // TODO: This should be configurable, such as if we are looking for .json or .toml or custom paths | ||
| // For now it is hard-coded to be toml. | ||
| self.root_dir.join(format!("{VERIFIER_INPUT_FILE}.toml")) | ||
| } | ||
| } | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.