What is the proposed / planned way to configure / install software using the Rust Cargo system as a build system?

Existing build systems usually have some kind of installation targets that are used either manually (for installation in / usr / local or another place that the user can access), or automatically (build systems for packages from binary distributions or source package managers) .

What is the intended way to install software using Cargo? What should an analog look like make install?

Cargo itself uses an additional configure / make file that handles configuration, detection of system dependencies, startup cargo buildand installation.

Is this correct for any other software created with Cargo? Does this mean that it is planned to cover these tasks with Cargo itself or is Cargo intended only as a tool for collecting and compiling dependencies without any configuration / detection of installed deps / installation?

Or are you planning to add this functionality?

+4
source share
1 answer

cargo install

In Rust 1.5, you can use cargo installto install binary boxes on your system. You can install boxes from:

  • crates.io (default) using cargo install crate_name
  • any git repository using cargo install --git repository_url
  • any directory using cargo install --path /path/to/crate

The first two have additional parameters that you can specify:

  • crates.io --vers .
  • git --branch, --tag, , --rev .

:

cargo install ( ):

  • --root /path/to/directory ( )
  • $CARGO_INSTALL_ROOT
  • install.root ,
  • $CARGO_HOME ( , cargo install)

, ~/.cargo/bin.

bin (, --root /path/to/directory /path/to/directory/bin).

cargo uninstall . , --root .

: rustfmt:

crates.io:

  • cargo install rustfmt

:

  • cargo install rustfmt --vers 0.0.1

, /opt/rust_crates:

  • cargo install rustfmt --root /opt/rust_crates

:

  • cargo install --git https://github.com/rust-lang-nursery/rustfmt.git

!

  • cargo install --git https://github.com/rust-lang-nursery/rustfmt.git --rev f5bd7b76e0185e8dd37ae6b1b5fb5e11187f0b8c

, git :

  • cargo install --git https://github.com/rust-lang-nursery/rustfmt.git --branch submods

:

  • cargo install --path ~/my_rustfmt

, , :

  • cargo uninstall rustfmt
+12

All Articles