-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Normalize --path when install bin outside current workspace #10335
Merged
Conversation
This file contains 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
Make up this test case to reflect the current incorrect behavior.
For `Workspace::find_root`, `cargo_util::path::PathAncestors` won't do path normalization while walking back the ancestors. The responsibility lies in the caller. Thus, `cargo install` should normalize its `--path` argument before passing in `SourceId::for_path` and `Workspace::new`. `Config::reload_rooted_at` is not affected because cargo always starts searching and merging configs from where it is invoked.
(rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 27, 2022
weihanglo
changed the title
Normalize --path to install bin outside current workspace
Normalize --path when install bin outside current workspace
Jan 27, 2022
Oops. Seems that clap updates its error message with optional args. Edited: Upgrade clap: #10336 |
@bors: r+ Looks good to me, thanks! |
📌 Commit 76301eb has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 27, 2022
☀️ Test successful - checks-actions |
ehuss
added a commit
to ehuss/rust
that referenced
this pull request
Feb 1, 2022
Update cargo 10 commits in 1c034752de0df744fcd7788fcbca158830b8bf85..25fcb135d02ea897ce894b67ae021f48107d522b 2022-01-25 22:36:53 +0000 to 2022-02-01 01:32:48 +0000 - fix(install): Keep v1 file formatting the same (rust-lang/cargo#10349) - fix(vendor): Use tables for sample config (rust-lang/cargo#10348) - Add bash completion for `cargo clippy` (rust-lang/cargo#10347) - Do not ignore `--features` when `--all-features` is present (rust-lang/cargo#10337) - test: Fix compatibilty with new toml_edit (rust-lang/cargo#10350) - extra-link-arg-etc: support all link types (credit `@davidhewitt)` (rust-lang/cargo#10274) - Make clippy happy (rust-lang/cargo#10340) - Update publishing link for semver rules. (rust-lang/cargo#10338) - Normalize --path when install bin outside current workspace (rust-lang/cargo#10335) - Bump clap to v3.0.13 (rust-lang/cargo#10336)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
What does this PR try to resolve?
Fixes #10283
For
Workspace::find_root
,cargo_util::path::PathAncestors
won't dopath normalization while walking back the ancestors. The responsibility
lies in the caller. Thus,
cargo install
should normalize its--path
argument before passing in
SourceId::for_path
andWorkspace::new
.Config::reload_rooted_at
is not affected because cargo always startssearching and merging configs from where it is invoked.
How should we test and review this PR?
A new test
install::install_relative_path_outside_current_ws
should cover this case.You can also follow the reproducible steps described in #10283.