-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix(nargo): resolve local dependencies relative to root of depending package #1034
Conversation
Thanks for flagging up this edge case, I'll make sure to add some tests to run commands away from the package root at some point. WRT this PR though, I think of this as just another occurrence of #1013. My preference for this is that we pass the package root directory (i.e. |
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.
LGTM.
@TomAFrench what do you think?
LGTM however I haven't tested it locally. |
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.
Tested this locally and we're for a dependency chain A->B->C, we're now properly resolving C relative to B rather than A
Related issue(s)
Resolves #
Description
When running
nargo
in a subdirectory of a package whoseNargo.toml
file contains a local dependency expressed as a relative path (e.g.pkg = { path = "../../lib" }
), the dependency is parsed relative to the subdirectory, resoluting in an error of the formThis PR sets the current directory to the project root before executing
nargo
commands.Summary of changes
std::env::set_current_dir
after determining the project root.Dependency additions / changes
Test additions / changes
Checklist
cargo fmt
with default settings.Documentation needs
Additional context
BEGIN_COMMIT_OVERRIDE
fix(nargo): resolve local dependencies relative to root of depending package
END_COMMIT_OVERRIDE