Manage Rust project dependencies
Configure and vendor dependencies for Rust projects on Red Hat Enterprise Linux by using the Cargo build tool to control crate versions and offline builds.
Prerequisites Copy linkLink copied!
- Rust Toolset is installed.
Configure Rust project dependencies Copy linkLink copied!
Configure the dependencies of your Rust project by using the Cargo build tool. Edit the Cargo.toml file in the project directory and rebuild your project. Cargo downloads packages and dependencies locally. Use cargo build or cargo run to compile your code and produce a runnable executable.
Before you begin Copy linkLink copied!
Procedure Copy linkLink copied!
Vendor Rust project dependencies Copy linkLink copied!
Create a local copy of the dependencies of your Rust project for offline redistribution by using the Cargo build tool (vendoring). Vendored sources live in the vendor directory, including any Windows-target crates you captured. Point Cargo at that tree to build offline without network access.
Before you begin Copy linkLink copied!
Procedure Copy linkLink copied!
$ cargo vendor