Skip to content
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

Add some simple form of workspace file #794

Closed
Tracked by #2162
TomAFrench opened this issue Feb 9, 2023 · 3 comments · Fixed by #1992
Closed
Tracked by #2162

Add some simple form of workspace file #794

TomAFrench opened this issue Feb 9, 2023 · 3 comments · Fixed by #1992
Assignees
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

Problem

I would like to be able to have several noir crates in a repository and interact with them from the repository root.

Solution

We should add some form of workspace file similar to this repository's Cargo.toml. This would specify the paths of each of the Noir crates in the repository so Nargo can find them easily.

Using this we could perform actions such as

  • running all the tests in a single command from the repository root
  • prove against a circuit in a different directory by specifying -p crate_name
  • specify a default crate to interact with (similarly to how we have nargo as the default crate in this repository).

Alternatives considered

We could either maintain that the user has to cd into each crate themselves (this isn't particularly nice from a CI perspective).

Alternatively we could search all subdirectories of the current directory for Noir crates, but this seems needlessly complicated.

Additional context

@ghost
Copy link

ghost commented Jul 11, 2023

In the initial phase, I aim to investigate the extension of the manifest, akin to Rust's approach:

[workspace]
members = [
    "path/to/first_member", 
    "path/to/second_member"
]

..and a command to run tests

One of the prominent features is the ability to consolidate all components into a single target folder when executing the build process. If anyone has any suggestions or tips regarding this aspect.

@kevaundray
Copy link
Contributor

Linking here but we can put it in another issue, it was noted internally that it would be good to generate ABIs for not only this contract, but also the contract's dependencies. Our tooling around dependencies is not that mature so I think we can brainstorm around that at a later point while we mature the dependency tooling

@ghost
Copy link

ghost commented Jul 13, 2023

cargo checks the workspace, ensuring that a number of invariants are met:

  1. A workspace only has one root.
  2. All workspace members agree on this one root as the root.
  3. Unique package names in the workspace.

It probably makes sense to support that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants