Skip to content

Commit

Permalink
Clarify where packages are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jul 13, 2015
1 parent 362090e commit 3214bb3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions text/0000-cargo-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Options:
-p, --package CRATE Install this crate from crates.io or select the
package in a repository/path to install.
-v, --verbose Use verbose output
--root Directory to install packages into
This command manages Cargo's local set of install binary crates. Only packages
which have [[bin]] targets can be installed, and all binaries are installed into
Expand Down Expand Up @@ -84,9 +85,8 @@ crates.

Cargo attempts to be as flexible as possible in terms of installing crates from
various locations and specifying what should be installed. All binaries will be
stored in the **cargo-local** directory `$CARGO_HOME/bin`. This is typically
`$HOME/.cargo/bin` but the home directory can be modified via the `$CARGO_HOME`
environment variable.
stored in a **cargo-local** directory, and more details on where exactly this is
located can be found below.

Cargo will not attempt to install binaries or crates into system directories
(e.g. `/usr`) as that responsibility is intended for system package managers.
Expand Down Expand Up @@ -140,6 +140,24 @@ binary called `foo` they cannot be both installed at once. Cargo will reject
these situations and recommend that a binary is selected via `--bin` or the
conflicting crate is uninstalled.

#### Placing output artifacts

The `cargo install` command can be customized where it puts its output artifacts
to install packages in a custom location. The root directory of the installation
will be determined in a hierarchical fashion, choosing the first of the
following that is specified:

1. The `--root` argument on the command line.
2. The environment variable `CARGO_INSTALL_ROOT`.
3. The `install.root` configuration option.
4. The value of `$CARGO_HOME` (also determined in an independent and
hierarchical fashion).

Once the root directory is found, Cargo will place all binaries in the
`$INSTALL_ROOT/bin` folder. Cargo will also reserve the right to retain some
metadata in this folder in order to keep track of what's installed and what
binaries belong to which package.

## Managing Installations

If Cargo gives access to installing packages, it should surely provide the
Expand Down

0 comments on commit 3214bb3

Please sign in to comment.