]> git.proxmox.com Git - cargo.git/blame - src/doc/src/commands/cargo-vendor.md
Merge branch 'debian/sid' into proxmox/bullseye
[cargo.git] / src / doc / src / commands / cargo-vendor.md
CommitLineData
2d4aa38b
EH
1# cargo-vendor(1)
2
3## NAME
4
5cargo-vendor - Vendor all dependencies locally
6
7## SYNOPSIS
8
9`cargo vendor` [_options_] [_path_]
10
11## DESCRIPTION
12
13This cargo subcommand will vendor all crates.io and git dependencies for a
14project into the specified directory at `<path>`. After this command completes
15the vendor directory specified by `<path>` will contain all remote sources from
16dependencies specified. Additional manifests beyond the default one can be
17specified with the `-s` option.
18
19The `cargo vendor` command will also print out the configuration necessary
20to use the vendored sources, which you will need to add to `.cargo/config.toml`.
21
22## OPTIONS
23
24### Vendor Options
25
26<dl>
27
28<dt class="option-term" id="option-cargo-vendor--s"><a class="option-anchor" href="#option-cargo-vendor--s"></a><code>-s</code> <em>manifest</em></dt>
29<dt class="option-term" id="option-cargo-vendor---sync"><a class="option-anchor" href="#option-cargo-vendor---sync"></a><code>--sync</code> <em>manifest</em></dt>
d41f5ccd
AE
30<dd class="option-desc">Specify an extra <code>Cargo.toml</code> manifest to workspaces which should also be
31vendored and synced to the output. May be specified multiple times.</dd>
2d4aa38b
EH
32
33
34<dt class="option-term" id="option-cargo-vendor---no-delete"><a class="option-anchor" href="#option-cargo-vendor---no-delete"></a><code>--no-delete</code></dt>
35<dd class="option-desc">Don't delete the &quot;vendor&quot; directory when vendoring, but rather keep all
36existing contents of the vendor directory</dd>
37
38
39<dt class="option-term" id="option-cargo-vendor---respect-source-config"><a class="option-anchor" href="#option-cargo-vendor---respect-source-config"></a><code>--respect-source-config</code></dt>
40<dd class="option-desc">Instead of ignoring <code>[source]</code> configuration by default in <code>.cargo/config.toml</code>
41read it and use it when downloading crates from crates.io, for example</dd>
42
43
44<dt class="option-term" id="option-cargo-vendor---versioned-dirs"><a class="option-anchor" href="#option-cargo-vendor---versioned-dirs"></a><code>--versioned-dirs</code></dt>
45<dd class="option-desc">Normally versions are only added to disambiguate multiple versions of the
46same package. This option causes all directories in the &quot;vendor&quot; directory
47to be versioned, which makes it easier to track the history of vendored
48packages over time, and can help with the performance of re-vendoring when
49only a subset of the packages have changed.</dd>
50
51
52</dl>
53
54### Manifest Options
55
56<dl>
57
58<dt class="option-term" id="option-cargo-vendor---manifest-path"><a class="option-anchor" href="#option-cargo-vendor---manifest-path"></a><code>--manifest-path</code> <em>path</em></dt>
59<dd class="option-desc">Path to the <code>Cargo.toml</code> file. By default, Cargo searches for the
60<code>Cargo.toml</code> file in the current directory or any parent directory.</dd>
61
62
63
64<dt class="option-term" id="option-cargo-vendor---frozen"><a class="option-anchor" href="#option-cargo-vendor---frozen"></a><code>--frozen</code></dt>
65<dt class="option-term" id="option-cargo-vendor---locked"><a class="option-anchor" href="#option-cargo-vendor---locked"></a><code>--locked</code></dt>
66<dd class="option-desc">Either of these flags requires that the <code>Cargo.lock</code> file is
67up-to-date. If the lock file is missing, or it needs to be updated, Cargo will
68exit with an error. The <code>--frozen</code> flag also prevents Cargo from
69attempting to access the network to determine if it is out-of-date.</p>
70<p>These may be used in environments where you want to assert that the
71<code>Cargo.lock</code> file is up-to-date (such as a CI build) or want to avoid network
72access.</dd>
73
74
75<dt class="option-term" id="option-cargo-vendor---offline"><a class="option-anchor" href="#option-cargo-vendor---offline"></a><code>--offline</code></dt>
76<dd class="option-desc">Prevents Cargo from accessing the network for any reason. Without this
77flag, Cargo will stop with an error if it needs to access the network and
78the network is not available. With this flag, Cargo will attempt to
79proceed without the network if possible.</p>
80<p>Beware that this may result in different dependency resolution than online
81mode. Cargo will restrict itself to crates that are downloaded locally, even
82if there might be a newer version as indicated in the local copy of the index.
1a86f232 83See the <a href="cargo-fetch.html">cargo-fetch(1)</a> command to download dependencies before going
2d4aa38b 84offline.</p>
1a86f232 85<p>May also be specified with the <code>net.offline</code> <a href="../reference/config.html">config value</a>.</dd>
2d4aa38b
EH
86
87
88
89</dl>
90
91### Display Options
92
93<dl>
94
95<dt class="option-term" id="option-cargo-vendor--v"><a class="option-anchor" href="#option-cargo-vendor--v"></a><code>-v</code></dt>
96<dt class="option-term" id="option-cargo-vendor---verbose"><a class="option-anchor" href="#option-cargo-vendor---verbose"></a><code>--verbose</code></dt>
97<dd class="option-desc">Use verbose output. May be specified twice for &quot;very verbose&quot; output which
98includes extra output such as dependency warnings and build script output.
99May also be specified with the <code>term.verbose</code>
1a86f232 100<a href="../reference/config.html">config value</a>.</dd>
2d4aa38b
EH
101
102
103<dt class="option-term" id="option-cargo-vendor--q"><a class="option-anchor" href="#option-cargo-vendor--q"></a><code>-q</code></dt>
104<dt class="option-term" id="option-cargo-vendor---quiet"><a class="option-anchor" href="#option-cargo-vendor---quiet"></a><code>--quiet</code></dt>
cd4e2804
SJ
105<dd class="option-desc">Do not print cargo log messages.
106May also be specified with the <code>term.quiet</code>
107<a href="../reference/config.html">config value</a>.</dd>
2d4aa38b
EH
108
109
110<dt class="option-term" id="option-cargo-vendor---color"><a class="option-anchor" href="#option-cargo-vendor---color"></a><code>--color</code> <em>when</em></dt>
111<dd class="option-desc">Control when colored output is used. Valid values:</p>
112<ul>
113<li><code>auto</code> (default): Automatically detect if color support is available on the
114terminal.</li>
115<li><code>always</code>: Always display colors.</li>
116<li><code>never</code>: Never display colors.</li>
117</ul>
118<p>May also be specified with the <code>term.color</code>
1a86f232 119<a href="../reference/config.html">config value</a>.</dd>
2d4aa38b
EH
120
121
122
123</dl>
124
125### Common Options
126
127<dl>
128
129<dt class="option-term" id="option-cargo-vendor-+toolchain"><a class="option-anchor" href="#option-cargo-vendor-+toolchain"></a><code>+</code><em>toolchain</em></dt>
130<dd class="option-desc">If Cargo has been installed with rustup, and the first argument to <code>cargo</code>
131begins with <code>+</code>, it will be interpreted as a rustup toolchain name (such
132as <code>+stable</code> or <code>+nightly</code>).
fac70ee7 133See the <a href="https://rust-lang.github.io/rustup/overrides.html">rustup documentation</a>
2d4aa38b
EH
134for more information about how toolchain overrides work.</dd>
135
136
65332bc9
WL
137<dt class="option-term" id="option-cargo-vendor---config"><a class="option-anchor" href="#option-cargo-vendor---config"></a><code>--config</code> <em>KEY=VALUE</em> or <em>PATH</em></dt>
138<dd class="option-desc">Overrides a Cargo configuration value. The argument should be in TOML syntax of <code>KEY=VALUE</code>,
139or provided as a path to an extra configuration file. This flag may be specified multiple times.
140See the <a href="../reference/config.html#command-line-overrides">command-line overrides section</a> for more information.</dd>
7eefb422
JG
141
142
2d4aa38b
EH
143<dt class="option-term" id="option-cargo-vendor--h"><a class="option-anchor" href="#option-cargo-vendor--h"></a><code>-h</code></dt>
144<dt class="option-term" id="option-cargo-vendor---help"><a class="option-anchor" href="#option-cargo-vendor---help"></a><code>--help</code></dt>
145<dd class="option-desc">Prints help information.</dd>
146
147
148<dt class="option-term" id="option-cargo-vendor--Z"><a class="option-anchor" href="#option-cargo-vendor--Z"></a><code>-Z</code> <em>flag</em></dt>
149<dd class="option-desc">Unstable (nightly-only) flags to Cargo. Run <code>cargo -Z help</code> for details.</dd>
150
151
152</dl>
153
154
155## ENVIRONMENT
156
157See [the reference](../reference/environment-variables.html) for
158details on environment variables that Cargo reads.
159
160
161## EXIT STATUS
162
163* `0`: Cargo succeeded.
164* `101`: Cargo failed to complete.
165
166
167## EXAMPLES
168
1691. Vendor all dependencies into a local "vendor" folder
170
171 cargo vendor
172
1732. Vendor all dependencies into a local "third-party/vendor" folder
174
175 cargo vendor third-party/vendor
176
1773. Vendor the current workspace as well as another to "vendor"
178
179 cargo vendor -s ../path/to/Cargo.toml
180
181## SEE ALSO
1a86f232 182[cargo(1)](cargo.html)
3842d8e6 183