1CARGO-FETCH(1) CARGO-FETCH(1)
2
3
4
6 cargo-fetch - Fetch dependencies of a package from the network
7
9 cargo fetch [OPTIONS]
10
12 If a Cargo.lock file is available, this command will ensure that all of
13 the git dependencies and/or registry dependencies are downloaded and
14 locally available. Subsequent Cargo commands never touch the network
15 after a cargo fetch unless the lock file changes.
16
17 If the lock file is not available, then this command will generate the
18 lock file before fetching the dependencies.
19
20 If --target is not specified, then all target dependencies are fetched.
21
22 See also the cargo-prefetch <https://crates.io/crates/cargo-prefetch>
23 plugin which adds a command to download popular crates. This may be
24 useful if you plan to use Cargo without a network with the --offline
25 flag.
26
28 Fetch options
29 --target TRIPLE
30 Fetch for the given architecture. The default is the host
31 architecture. The general format of the triple is
32 <arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
33 a list of supported targets.
34
35 This may also be specified with the build.target config value
36 <https://doc.rust-lang.org/cargo/reference/config.html>.
37
38 Note that specifying this flag makes Cargo run in a different mode
39 where the target artifacts are placed in a separate directory. See
40 the build cache
41 <https://doc.rust-lang.org/cargo/guide/build-cache.html>
42 documentation for more details.
43
44 Display Options
45 -v, --verbose
46 Use verbose output. May be specified twice for "very verbose"
47 output which includes extra output such as dependency warnings and
48 build script output. May also be specified with the term.verbose
49 config value
50 <https://doc.rust-lang.org/cargo/reference/config.html>.
51
52 -q, --quiet
53 No output printed to stdout.
54
55 --color WHEN
56 Control when colored output is used. Valid values:
57
58 · auto (default): Automatically detect if color support is
59 available on the terminal.
60
61 · always: Always display colors.
62
63 · never: Never display colors.
64
65 May also be specified with the term.color config value
66 <https://doc.rust-lang.org/cargo/reference/config.html>.
67
68 Manifest Options
69 --manifest-path PATH
70 Path to the Cargo.toml file. By default, Cargo searches for the
71 Cargo.toml file in the current directory or any parent directory.
72
73 --frozen, --locked
74 Either of these flags requires that the Cargo.lock file is
75 up-to-date. If the lock file is missing, or it needs to be updated,
76 Cargo will exit with an error. The --frozen flag also prevents
77 Cargo from attempting to access the network to determine if it is
78 out-of-date.
79
80 These may be used in environments where you want to assert that the
81 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
82 network access.
83
84 --offline
85 Prevents Cargo from accessing the network for any reason. Without
86 this flag, Cargo will stop with an error if it needs to access the
87 network and the network is not available. With this flag, Cargo
88 will attempt to proceed without the network if possible.
89
90 Beware that this may result in different dependency resolution than
91 online mode. Cargo will restrict itself to crates that are
92 downloaded locally, even if there might be a newer version as
93 indicated in the local copy of the index. See the cargo-fetch(1)
94 command to download dependencies before going offline.
95
96 May also be specified with the net.offline config value
97 <https://doc.rust-lang.org/cargo/reference/config.html>.
98
99 Common Options
100 -h, --help
101 Prints help information.
102
103 -Z FLAG...
104 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
105 details.
106
108 See the reference
109 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
110 for details on environment variables that Cargo reads.
111
113 0
114 Cargo succeeded.
115
116 101
117 Cargo failed to complete.
118
120 1. Fetch all dependencies:
121
122 cargo fetch
123
125 cargo(1), cargo-update(1), cargo-generate-lockfile(1)
126
127
128
129 2019-11-11 CARGO-FETCH(1)