LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

cargo-vendor

Vendor all dependencies locally

TLDR

Vendor dependencies
$ cargo vendor
copy
Vendor to specific directory
$ cargo vendor [vendor/]
copy
Vendor and save config
$ cargo vendor > .cargo/config.toml
copy
Vendor with versioned directories
$ cargo vendor --versioned-dirs
copy
Vendor specific package
$ cargo vendor -s [package/Cargo.toml]
copy

SYNOPSIS

cargo vendor [options] [path]

DESCRIPTION

cargo vendor downloads and copies all crates.io and git dependencies into a local directory (default: `vendor/`). It outputs the Cargo configuration needed to redirect dependency resolution to the vendored sources.This is primarily used for offline builds, air-gapped environments, and reproducible build systems where network access during compilation is not available or not desired. The vendored sources are read-only; to modify a vendored crate, use the `[patch]` section in Cargo.toml instead of editing files directly in the vendor directory.

PARAMETERS

-s, --sync path

Additional Cargo.toml to sync
--no-delete
Don't delete existing vendor directory
--versioned-dirs
Use versioned directory names
--respect-source-config
Respect [source] config when vendoring
--manifest-path path
Path to Cargo.toml
-v, --verbose
Verbose output
-q, --quiet
Suppress output

CONFIGURATION

.cargo/config.toml

Source replacement settings that redirect dependency resolution to the vendored directory. The output of `cargo vendor` provides the exact configuration to add.

OFFLINE BUILDS

After vendoring:

$ cargo build --offline
copy

INSTALL

sudo apt install cargo
copy
sudo dnf install cargo
copy
sudo apk add cargo
copy
sudo zypper install cargo
copy
nix profile install nixpkgs#cargo
copy

CAVEATS

Vendored sources are read-only. Use [patch] for modifications. Resolution may differ from online mode. Run cargo fetch first for complete dependency download.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid