1CARGO-GENERATE-LOCKFILE(1) General Commands Manual CARGO-GENERATE-LOCKFILE(1)
2
3
4
6 cargo-generate-lockfile - Generate the lockfile for a package
7
9 cargo generate-lockfile [options]
10
12 This command will create the Cargo.lock lockfile for the current
13 package or workspace. If the lockfile already exists, it will be
14 rebuilt with the latest available version of every package.
15
16 See also cargo-update(1) which is also capable of creating a Cargo.lock
17 lockfile and has more options for controlling update behavior.
18
20 Display Options
21 -v, --verbose
22 Use verbose output. May be specified twice for "very verbose"
23 output which includes extra output such as dependency warnings and
24 build script output. May also be specified with the term.verbose
25 config value
26 <https://doc.rust-lang.org/cargo/reference/config.html>.
27
28 -q, --quiet
29 No output printed to stdout.
30
31 --color when
32 Control when colored output is used. Valid values:
33
34 · auto (default): Automatically detect if color support is
35 available on the terminal.
36
37 · always: Always display colors.
38
39 · never: Never display colors.
40
41 May also be specified with the term.color config value
42 <https://doc.rust-lang.org/cargo/reference/config.html>.
43
44 Manifest Options
45 --manifest-path path
46 Path to the Cargo.toml file. By default, Cargo searches for the
47 Cargo.toml file in the current directory or any parent directory.
48
49 --frozen, --locked
50 Either of these flags requires that the Cargo.lock file is
51 up-to-date. If the lock file is missing, or it needs to be updated,
52 Cargo will exit with an error. The --frozen flag also prevents
53 Cargo from attempting to access the network to determine if it is
54 out-of-date.
55
56 These may be used in environments where you want to assert that the
57 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
58 network access.
59
60 --offline
61 Prevents Cargo from accessing the network for any reason. Without
62 this flag, Cargo will stop with an error if it needs to access the
63 network and the network is not available. With this flag, Cargo
64 will attempt to proceed without the network if possible.
65
66 Beware that this may result in different dependency resolution than
67 online mode. Cargo will restrict itself to crates that are
68 downloaded locally, even if there might be a newer version as
69 indicated in the local copy of the index. See the cargo-fetch(1)
70 command to download dependencies before going offline.
71
72 May also be specified with the net.offline config value
73 <https://doc.rust-lang.org/cargo/reference/config.html>.
74
75 Common Options
76 +toolchain
77 If Cargo has been installed with rustup, and the first argument to
78 cargo begins with +, it will be interpreted as a rustup toolchain
79 name (such as +stable or +nightly). See the rustup documentation
80 <https://rust-lang.github.io/rustup/overrides.html> for more
81 information about how toolchain overrides work.
82
83 -h, --help
84 Prints help information.
85
86 -Z flag
87 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
88 details.
89
91 See the reference
92 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
93 for details on environment variables that Cargo reads.
94
96 · 0: Cargo succeeded.
97
98 · 101: Cargo failed to complete.
99
101 1. Create or update the lockfile for the current package or workspace:
102
103 cargo generate-lockfile
104
106 cargo(1), cargo-update(1)
107
108
109
110 CARGO-GENERATE-LOCKFILE(1)