-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Running cargo install installs the binaries for the project in current working directory. This might be a surprising behavior for people coming from other ecosystems, especially the node one. The confusion here is that, in Cargo, you don't need to "install" a library to actually use it. At the same time, installing local crates seems like a niche use-case, one typically installs crates from crates.io.
So let's fix confusion by printing a warning, in the next edition, when a user invokes cargo install. The warning should say:
- If you care coming from other ecosystems, you probably have meant
cargo build - If you really want to install current package, run
cargo install --path .
The code for install command is here:
cargo/src/bin/commands/install.rs
Line 81 in d8b2031
To check the current edition, one can use this method:
cargo/src/cargo/core/manifest.rs
Line 409 in d8b2031
| pub fn edition(&self) -> Edition { |
The tests for install are here: