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

Import a git dependency by specifying a url and filepath _not_ at the repo's root. #2102

Closed
iAmMichaelConnor opened this issue Aug 1, 2023 · 2 comments · Fixed by #2436
Closed
Assignees
Labels
discussion enhancement New feature or request nargo Noir's CLI development tool

Comments

@iAmMichaelConnor
Copy link
Collaborator

iAmMichaelConnor commented Aug 1, 2023

Problem

Currently, to use our standard library of Aztec contract helper functions and structs, you need to develop your contract inside aztec-packages, by specifying the relative path to the library, in the contract's Nargo.toml.

Alternatively, Nargo also allows a GitHub url of the dependency to be provided, but the Nargo.toml of the dependency must be at the top level of the repo (whereas our noir lib is currently nested inside yarn-project/).

Is there a way to specify a filepath to the Nargo.toml, from the git repo's root?

Happy Case

A user can specify a url and filepath to the Nargo.toml file of our noir contracts library.

Alternatives Considered

We could, potentially:

  • Move the Nargo file to the root of aztec-packages, but that would go against our filing structure.
  • Move the noir contracts library into a separate repo, but that would go against our monorepo approach.

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@iAmMichaelConnor iAmMichaelConnor added the enhancement New feature or request label Aug 1, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 1, 2023
@iAmMichaelConnor iAmMichaelConnor changed the title Import a git dependency by specifying a url _not_ at the repo's root. Import a git dependency by specifying a url and filepath _not_ at the repo's root. Aug 1, 2023
@kobyhallx
Copy link
Contributor

We would need to add an option to specify dir for where search of Workspace/Package spec begins. Eg.
github:AztecProtocol/aztec-packages?dir=zktoken

@kobyhallx kobyhallx self-assigned this Aug 1, 2023
@kobyhallx kobyhallx added nargo Noir's CLI development tool P-MEDIUM labels Aug 1, 2023
@phated
Copy link
Contributor

phated commented Aug 1, 2023

For the Nargo.toml file, I think we can support this by adding a field to the DependencyConfig, such as

dep = { git = "https://repo-url", tag = "v1", directory = "relative-subdir-path" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request nargo Noir's CLI development tool
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants