1CARGO-VENDOR(1) General Commands Manual CARGO-VENDOR(1)
2
3
4
6 cargo-vendor - Vendor all dependencies locally
7
9 cargo vendor [options] [path]
10
12 This cargo subcommand will vendor all crates.io and git dependencies
13 for a project into the specified directory at <path>. After this
14 command completes the vendor directory specified by <path> will contain
15 all remote sources from dependencies specified. Additional manifests
16 beyond the default one can be specified with the -s option.
17
18 The cargo vendor command will also print out the configuration
19 necessary to use the vendored sources, which you will need to add to
20 .cargo/config.toml.
21
23 Vendor Options
24 -s manifest, --sync manifest
25 Specify extra Cargo.toml manifests to workspaces which should also
26 be vendored and synced to the output.
27
28 --no-delete
29 Don't delete the "vendor" directory when vendoring, but rather keep
30 all existing contents of the vendor directory
31
32 --respect-source-config
33 Instead of ignoring [source] configuration by default in
34 .cargo/config.toml read it and use it when downloading crates from
35 crates.io, for example
36
37 --versioned-dirs
38 Normally versions are only added to disambiguate multiple versions
39 of the same package. This option causes all directories in the
40 "vendor" directory to be versioned, which makes it easier to track
41 the history of vendored packages over time, and can help with the
42 performance of re-vendoring when only a subset of the packages have
43 changed.
44
45 Manifest Options
46 --manifest-path path
47 Path to the Cargo.toml file. By default, Cargo searches for the
48 Cargo.toml file in the current directory or any parent directory.
49
50 --frozen, --locked
51 Either of these flags requires that the Cargo.lock file is
52 up-to-date. If the lock file is missing, or it needs to be updated,
53 Cargo will exit with an error. The --frozen flag also prevents
54 Cargo from attempting to access the network to determine if it is
55 out-of-date.
56
57 These may be used in environments where you want to assert that the
58 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
59 network access.
60
61 --offline
62 Prevents Cargo from accessing the network for any reason. Without
63 this flag, Cargo will stop with an error if it needs to access the
64 network and the network is not available. With this flag, Cargo
65 will attempt to proceed without the network if possible.
66
67 Beware that this may result in different dependency resolution than
68 online mode. Cargo will restrict itself to crates that are
69 downloaded locally, even if there might be a newer version as
70 indicated in the local copy of the index. See the cargo-fetch(1)
71 command to download dependencies before going offline.
72
73 May also be specified with the net.offline config value
74 <https://doc.rust-lang.org/cargo/reference/config.html>.
75
76 Display Options
77 -v, --verbose
78 Use verbose output. May be specified twice for "very verbose"
79 output which includes extra output such as dependency warnings and
80 build script output. May also be specified with the term.verbose
81 config value
82 <https://doc.rust-lang.org/cargo/reference/config.html>.
83
84 -q, --quiet
85 No output printed to stdout.
86
87 --color when
88 Control when colored output is used. Valid values:
89
90 · auto (default): Automatically detect if color support is
91 available on the terminal.
92
93 · always: Always display colors.
94
95 · never: Never display colors.
96
97 May also be specified with the term.color config value
98 <https://doc.rust-lang.org/cargo/reference/config.html>.
99
100 Common Options
101 +toolchain
102 If Cargo has been installed with rustup, and the first argument to
103 cargo begins with +, it will be interpreted as a rustup toolchain
104 name (such as +stable or +nightly). See the rustup documentation
105 <https://rust-lang.github.io/rustup/overrides.html> for more
106 information about how toolchain overrides work.
107
108 -h, --help
109 Prints help information.
110
111 -Z flag
112 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
113 details.
114
116 See the reference
117 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
118 for details on environment variables that Cargo reads.
119
121 · 0: Cargo succeeded.
122
123 · 101: Cargo failed to complete.
124
126 1. Vendor all dependencies into a local "vendor" folder
127
128 cargo vendor
129
130 2. Vendor all dependencies into a local "third-party/vendor" folder
131
132 cargo vendor third-party/vendor
133
134 3. Vendor the current workspace as well as another to "vendor"
135
136 cargo vendor -s ../path/to/Cargo.toml
137
139 cargo(1)
140
141
142
143 CARGO-VENDOR(1)