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

cargo prints unrelated warnings on cargo install --git #8619

Closed
matthiaskrgr opened this issue Aug 14, 2020 · 5 comments · Fixed by #8681
Closed

cargo prints unrelated warnings on cargo install --git #8619

matthiaskrgr opened this issue Aug 14, 2020 · 5 comments · Fixed by #8681
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug Command-install E-easy Experience: Easy

Comments

@matthiaskrgr
Copy link
Member

Problem

When cargo installing a gitrepo project, cargo prints warnings of the workspace in the current cwd altough the workspace is completely unrelated and not touched.

Steps

  1. cd into the rustc repo @ 43bec40138bab10c08ac916bff2f2f81b2b70669
  2. cargo install --git https://github.com/matthiaskrgr/cargo-cache cargo-cache
  3. During install, cargo will print
warning: patch for the non root package will be ignored, specify patch at the workspace root:
package:   /home/matthias/vcs/github/rust/src/tools/rls/Cargo.toml
workspace: /home/matthias/vcs/github/rust/Cargo.toml
    Updating git repository `https://github.com/matthiaskrgr/cargo-cache`

although the current workspace/cwd is completely unrelated to the cargo install command.

Possible Solution(s)

Notes

Output of cargo version:

cargo 1.47.0-nightly (ab32ee88d 2020-08-10)
release: 1.47.0
commit-hash: ab32ee88dade1b50c77347599e82ca2de3fb8a51
commit-date: 2020-08-10
@matthiaskrgr matthiaskrgr added the C-bug Category: bug label Aug 14, 2020
@matthiaskrgr matthiaskrgr changed the title cargo prints unrelated warnings on cargo install cargo prints unrelated warnings on cargo install --git Aug 14, 2020
@ehuss
Copy link
Contributor

ehuss commented Aug 19, 2020

I believe this is due to this code which uses the workspace to provide better error messages for flags like --bin without an argument. That should probably be restructured somehow, though I'm not sure how. Maybe only build and pass in the workspace if --path is used (otherwise pass in None)?

@ehuss ehuss added A-diagnostics Area: Error and warning messages generated by Cargo itself. Command-install E-easy Experience: Easy labels Aug 19, 2020
@Rustin170506
Copy link
Member

Can I working on this?

@ehuss
Copy link
Contributor

ehuss commented Sep 7, 2020

@Rustin-Liu Go ahead! Let me know if you have any questions.

@ehuss
Copy link
Contributor

ehuss commented Sep 7, 2020

Oh, wait, I just noticed there's already a PR open for this. Sorry about that!

@Rustin170506
Copy link
Member

Oh, wait, I just noticed there's already a PR open for this. Sorry about that!

Got it. Thanks!

@bors bors closed this as completed in f110fd9 Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug Command-install E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants