-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 install
does not respect .cargo/config.toml
#11660
Comments
Thanks for the report! It is intentional behavior that
|
For the installation root precedence, the rule is not documented at all. It starts searching configurations upward from the given cargo/src/bin/cargo/commands/install.rs Lines 89 to 95 in efd3733
I wonder if we could reconsider calling |
Any reason why @rustbot claim |
Thanks for the explanation! |
I think in order to document the fact that
Something along the lines of
As the snippet is only used for the man pages of Somwhere here on the cargo/src/doc/man/cargo-install.md Lines 48 to 50 in 4262636
I'd add a note saying that using Any thoughts anyone? @weihanglo? |
I am fine with your suggestion, though it's a bit complicated. Not only In terms of the display on manpage, I only found one |
That was my reservation, too. I just couldn't figure out a good spot where I could add the relevant information in the text on first glance. Probably one paragraph describing the behaviour a little more detailed than I suggested is better. I'll figure something out and create a PR where we can discuss further details. |
Added documentation for the configuration discovery of `cargo install` to the man pages Fixes #11660.
Problem
When I run
cargo install ripgrep
in a directory with a.cargo/config.toml
overriding the install root (like below), it installs to$HOME/.cargo/bin
instead.The interesting thing is that
cargo uninstall
reads the configured root correctly, so if I immediately runcargo uninstall ripgrep
in the same directory, it complains thatpackage ID specification
ripgrepdid not match any packages
.Contents of
.cargo/config.toml
:Steps
apps
directorycargo install ripgrep
(or anything)Possible Solution(s)
No response
Notes
Also tried nightly just now with the same result.
Obviously I can just
cargo install --root apps ...
, but I was trying to experiment with patching dependencies and building with different compile options and it seemscargo install
is completely ignoring the configuration file.Version
The text was updated successfully, but these errors were encountered: