fix(nargo): resolve local dependencies relative to root of depending package#1034
Merged
TomAFrench merged 4 commits intonoir-lang:masterfrom Mar 25, 2023
Merged
fix(nargo): resolve local dependencies relative to root of depending package#1034TomAFrench merged 4 commits intonoir-lang:masterfrom
TomAFrench merged 4 commits intonoir-lang:masterfrom
Conversation
Member
|
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. |
jfecher
previously approved these changes
Mar 24, 2023
Contributor
jfecher
left a comment
There was a problem hiding this comment.
LGTM.
@TomAFrench what do you think?
Member
|
LGTM however I haven't tested it locally. |
kevaundray
reviewed
Mar 24, 2023
TomAFrench
requested changes
Mar 24, 2023
TomAFrench
approved these changes
Mar 25, 2023
1 task
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related issue(s)
Resolves #
Description
When running
nargoin a subdirectory of a package whoseNargo.tomlfile 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
nargocommands.Summary of changes
std::env::set_current_dirafter determining the project root.Dependency additions / changes
Test additions / changes
Checklist
cargo fmtwith default settings.Documentation needs
Additional context
BEGIN_COMMIT_OVERRIDE
fix(nargo): resolve local dependencies relative to root of depending package
END_COMMIT_OVERRIDE