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 Do not print cargo log messages. May also be specified with the
30 term.quiet config value
31 <https://doc.rust-lang.org/cargo/reference/config.html>.
32
33 --color when
34 Control when colored output is used. Valid values:
35
36 • auto (default): Automatically detect if color support is
37 available on the terminal.
38
39 • always: Always display colors.
40
41 • never: Never display colors.
42
43 May also be specified with the term.color config value
44 <https://doc.rust-lang.org/cargo/reference/config.html>.
45
46 Manifest Options
47 --manifest-path path
48 Path to the Cargo.toml file. By default, Cargo searches for the
49 Cargo.toml file in the current directory or any parent directory.
50
51 --frozen, --locked
52 Either of these flags requires that the Cargo.lock file is
53 up-to-date. If the lock file is missing, or it needs to be updated,
54 Cargo will exit with an error. The --frozen flag also prevents
55 Cargo from attempting to access the network to determine if it is
56 out-of-date.
57
58 These may be used in environments where you want to assert that the
59 Cargo.lock file is up-to-date (such as a CI build) or want to avoid
60 network access.
61
62 --offline
63 Prevents Cargo from accessing the network for any reason. Without
64 this flag, Cargo will stop with an error if it needs to access the
65 network and the network is not available. With this flag, Cargo
66 will attempt to proceed without the network if possible.
67
68 Beware that this may result in different dependency resolution than
69 online mode. Cargo will restrict itself to crates that are
70 downloaded locally, even if there might be a newer version as
71 indicated in the local copy of the index. See the cargo-fetch(1)
72 command to download dependencies before going offline.
73
74 May also be specified with the net.offline config value
75 <https://doc.rust-lang.org/cargo/reference/config.html>.
76
77 Common Options
78 +toolchain
79 If Cargo has been installed with rustup, and the first argument to
80 cargo begins with +, it will be interpreted as a rustup toolchain
81 name (such as +stable or +nightly). See the rustup documentation
82 <https://rust-lang.github.io/rustup/overrides.html> for more
83 information about how toolchain overrides work.
84
85 -h, --help
86 Prints help information.
87
88 -Z flag
89 Unstable (nightly-only) flags to Cargo. Run cargo -Z help for
90 details.
91
93 See the reference
94 <https://doc.rust-lang.org/cargo/reference/environment-variables.html>
95 for details on environment variables that Cargo reads.
96
98 • 0: Cargo succeeded.
99
100 • 101: Cargo failed to complete.
101
103 1. Create or update the lockfile for the current package or workspace:
104
105 cargo generate-lockfile
106
108 cargo(1), cargo-update(1)
109
110
111
112 CARGO-GENERATE-LOCKFILE(1)