Skip to content

Commit 3d9dea6

Browse files
committed
Auto merge of #13665 - weihanglo:locked-frozen, r=epage
docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile
2 parents acd673b + 26b2e74 commit 3d9dea6

File tree

109 files changed

+1192
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1192
-704
lines changed

src/bin/cargo/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,17 +640,17 @@ See '<cyan,bold>cargo help</> <cyan><<command>></>' for more information on a sp
640640
.value_parser(clap::builder::ValueParser::path_buf()),
641641
)
642642
.arg(
643-
flag("frozen", "Require Cargo.lock and cache to be up-to-date")
643+
flag("locked", "Assert that `Cargo.lock` will remain unchanged")
644644
.help_heading(heading::MANIFEST_OPTIONS)
645645
.global(true),
646646
)
647647
.arg(
648-
flag("locked", "Require Cargo.lock to be up-to-date")
648+
flag("offline", "Run without accessing the network")
649649
.help_heading(heading::MANIFEST_OPTIONS)
650650
.global(true),
651651
)
652652
.arg(
653-
flag("offline", "Run without accessing the network")
653+
flag("frozen", "Equivalent to specifying both --locked and --offline")
654654
.help_heading(heading::MANIFEST_OPTIONS)
655655
.global(true),
656656
)

src/doc/man/generated_txt/cargo-add.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,19 @@ OPTIONS
171171
-p spec, --package spec
172172
Add dependencies to only the specified package.
173173

174-
--frozen, --locked
175-
Either of these flags requires that the Cargo.lock file be
176-
up-to-date. If the lock file is missing, or it needs to be updated,
177-
Cargo will exit with an error. The --frozen flag also prevents Cargo
178-
from attempting to access the network to determine if it is
179-
out-of-date.
174+
--locked
175+
Asserts that the exact same dependencies and versions are used as
176+
when the existing Cargo.lock file was originally generated. Cargo
177+
will exit with an error when either of the following scenarios
178+
arises:
180179

181-
These may be used in environments where you want to assert that the
182-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
183-
network access.
180+
o The lock file is missing.
181+
182+
o Cargo attempted to change the lock file due to a different
183+
dependency resolution.
184+
185+
It may be used in environments where deterministic builds are
186+
desired, such as in CI pipelines.
184187

185188
--offline
186189
Prevents Cargo from accessing the network for any reason. Without
@@ -197,6 +200,9 @@ OPTIONS
197200
May also be specified with the net.offline config value
198201
<https://doc.rust-lang.org/cargo/reference/config.html>.
199202

203+
--frozen
204+
Equivalent to specifying both --locked and --offline.
205+
200206
Common Options
201207
+toolchain
202208
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-bench.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,19 @@ OPTIONS
338338
Path to the Cargo.toml file. By default, Cargo searches for the
339339
Cargo.toml file in the current directory or any parent directory.
340340

341-
--frozen, --locked
342-
Either of these flags requires that the Cargo.lock file be
343-
up-to-date. If the lock file is missing, or it needs to be updated,
344-
Cargo will exit with an error. The --frozen flag also prevents Cargo
345-
from attempting to access the network to determine if it is
346-
out-of-date.
341+
--locked
342+
Asserts that the exact same dependencies and versions are used as
343+
when the existing Cargo.lock file was originally generated. Cargo
344+
will exit with an error when either of the following scenarios
345+
arises:
347346

348-
These may be used in environments where you want to assert that the
349-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
350-
network access.
347+
o The lock file is missing.
348+
349+
o Cargo attempted to change the lock file due to a different
350+
dependency resolution.
351+
352+
It may be used in environments where deterministic builds are
353+
desired, such as in CI pipelines.
351354

352355
--offline
353356
Prevents Cargo from accessing the network for any reason. Without
@@ -364,6 +367,9 @@ OPTIONS
364367
May also be specified with the net.offline config value
365368
<https://doc.rust-lang.org/cargo/reference/config.html>.
366369

370+
--frozen
371+
Equivalent to specifying both --locked and --offline.
372+
367373
Common Options
368374
+toolchain
369375
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,19 @@ OPTIONS
272272
Path to the Cargo.toml file. By default, Cargo searches for the
273273
Cargo.toml file in the current directory or any parent directory.
274274

275-
--frozen, --locked
276-
Either of these flags requires that the Cargo.lock file be
277-
up-to-date. If the lock file is missing, or it needs to be updated,
278-
Cargo will exit with an error. The --frozen flag also prevents Cargo
279-
from attempting to access the network to determine if it is
280-
out-of-date.
275+
--locked
276+
Asserts that the exact same dependencies and versions are used as
277+
when the existing Cargo.lock file was originally generated. Cargo
278+
will exit with an error when either of the following scenarios
279+
arises:
281280

282-
These may be used in environments where you want to assert that the
283-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
284-
network access.
281+
o The lock file is missing.
282+
283+
o Cargo attempted to change the lock file due to a different
284+
dependency resolution.
285+
286+
It may be used in environments where deterministic builds are
287+
desired, such as in CI pipelines.
285288

286289
--offline
287290
Prevents Cargo from accessing the network for any reason. Without
@@ -298,6 +301,9 @@ OPTIONS
298301
May also be specified with the net.offline config value
299302
<https://doc.rust-lang.org/cargo/reference/config.html>.
300303

304+
--frozen
305+
Equivalent to specifying both --locked and --offline.
306+
301307
Common Options
302308
+toolchain
303309
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-check.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,19 @@ OPTIONS
257257
Path to the Cargo.toml file. By default, Cargo searches for the
258258
Cargo.toml file in the current directory or any parent directory.
259259

260-
--frozen, --locked
261-
Either of these flags requires that the Cargo.lock file be
262-
up-to-date. If the lock file is missing, or it needs to be updated,
263-
Cargo will exit with an error. The --frozen flag also prevents Cargo
264-
from attempting to access the network to determine if it is
265-
out-of-date.
260+
--locked
261+
Asserts that the exact same dependencies and versions are used as
262+
when the existing Cargo.lock file was originally generated. Cargo
263+
will exit with an error when either of the following scenarios
264+
arises:
266265

267-
These may be used in environments where you want to assert that the
268-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
269-
network access.
266+
o The lock file is missing.
267+
268+
o Cargo attempted to change the lock file due to a different
269+
dependency resolution.
270+
271+
It may be used in environments where deterministic builds are
272+
desired, such as in CI pipelines.
270273

271274
--offline
272275
Prevents Cargo from accessing the network for any reason. Without
@@ -283,6 +286,9 @@ OPTIONS
283286
May also be specified with the net.offline config value
284287
<https://doc.rust-lang.org/cargo/reference/config.html>.
285288

289+
--frozen
290+
Equivalent to specifying both --locked and --offline.
291+
286292
Common Options
287293
+toolchain
288294
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-clean.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,19 @@ OPTIONS
9191
Path to the Cargo.toml file. By default, Cargo searches for the
9292
Cargo.toml file in the current directory or any parent directory.
9393

94-
--frozen, --locked
95-
Either of these flags requires that the Cargo.lock file be
96-
up-to-date. If the lock file is missing, or it needs to be updated,
97-
Cargo will exit with an error. The --frozen flag also prevents Cargo
98-
from attempting to access the network to determine if it is
99-
out-of-date.
94+
--locked
95+
Asserts that the exact same dependencies and versions are used as
96+
when the existing Cargo.lock file was originally generated. Cargo
97+
will exit with an error when either of the following scenarios
98+
arises:
10099

101-
These may be used in environments where you want to assert that the
102-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
103-
network access.
100+
o The lock file is missing.
101+
102+
o Cargo attempted to change the lock file due to a different
103+
dependency resolution.
104+
105+
It may be used in environments where deterministic builds are
106+
desired, such as in CI pipelines.
104107

105108
--offline
106109
Prevents Cargo from accessing the network for any reason. Without
@@ -117,6 +120,9 @@ OPTIONS
117120
May also be specified with the net.offline config value
118121
<https://doc.rust-lang.org/cargo/reference/config.html>.
119122

123+
--frozen
124+
Equivalent to specifying both --locked and --offline.
125+
120126
Common Options
121127
+toolchain
122128
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-doc.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,19 @@ OPTIONS
228228
Path to the Cargo.toml file. By default, Cargo searches for the
229229
Cargo.toml file in the current directory or any parent directory.
230230

231-
--frozen, --locked
232-
Either of these flags requires that the Cargo.lock file be
233-
up-to-date. If the lock file is missing, or it needs to be updated,
234-
Cargo will exit with an error. The --frozen flag also prevents Cargo
235-
from attempting to access the network to determine if it is
236-
out-of-date.
231+
--locked
232+
Asserts that the exact same dependencies and versions are used as
233+
when the existing Cargo.lock file was originally generated. Cargo
234+
will exit with an error when either of the following scenarios
235+
arises:
237236

238-
These may be used in environments where you want to assert that the
239-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
240-
network access.
237+
o The lock file is missing.
238+
239+
o Cargo attempted to change the lock file due to a different
240+
dependency resolution.
241+
242+
It may be used in environments where deterministic builds are
243+
desired, such as in CI pipelines.
241244

242245
--offline
243246
Prevents Cargo from accessing the network for any reason. Without
@@ -254,6 +257,9 @@ OPTIONS
254257
May also be specified with the net.offline config value
255258
<https://doc.rust-lang.org/cargo/reference/config.html>.
256259

260+
--frozen
261+
Equivalent to specifying both --locked and --offline.
262+
257263
Common Options
258264
+toolchain
259265
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-fetch.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,19 @@ OPTIONS
7171
Path to the Cargo.toml file. By default, Cargo searches for the
7272
Cargo.toml file in the current directory or any parent directory.
7373

74-
--frozen, --locked
75-
Either of these flags requires that the Cargo.lock file be
76-
up-to-date. If the lock file is missing, or it needs to be updated,
77-
Cargo will exit with an error. The --frozen flag also prevents Cargo
78-
from attempting to access the network to determine if it is
79-
out-of-date.
74+
--locked
75+
Asserts that the exact same dependencies and versions are used as
76+
when the existing Cargo.lock file was originally generated. Cargo
77+
will exit with an error when either of the following scenarios
78+
arises:
8079

81-
These may be used in environments where you want to assert that the
82-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
83-
network access.
80+
o The lock file is missing.
81+
82+
o Cargo attempted to change the lock file due to a different
83+
dependency resolution.
84+
85+
It may be used in environments where deterministic builds are
86+
desired, such as in CI pipelines.
8487

8588
--offline
8689
Prevents Cargo from accessing the network for any reason. Without
@@ -96,6 +99,9 @@ OPTIONS
9699
May also be specified with the net.offline config value
97100
<https://doc.rust-lang.org/cargo/reference/config.html>.
98101

102+
--frozen
103+
Equivalent to specifying both --locked and --offline.
104+
99105
Common Options
100106
+toolchain
101107
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-fix.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,19 @@ OPTIONS
330330
Path to the Cargo.toml file. By default, Cargo searches for the
331331
Cargo.toml file in the current directory or any parent directory.
332332

333-
--frozen, --locked
334-
Either of these flags requires that the Cargo.lock file be
335-
up-to-date. If the lock file is missing, or it needs to be updated,
336-
Cargo will exit with an error. The --frozen flag also prevents Cargo
337-
from attempting to access the network to determine if it is
338-
out-of-date.
333+
--locked
334+
Asserts that the exact same dependencies and versions are used as
335+
when the existing Cargo.lock file was originally generated. Cargo
336+
will exit with an error when either of the following scenarios
337+
arises:
339338

340-
These may be used in environments where you want to assert that the
341-
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
342-
network access.
339+
o The lock file is missing.
340+
341+
o Cargo attempted to change the lock file due to a different
342+
dependency resolution.
343+
344+
It may be used in environments where deterministic builds are
345+
desired, such as in CI pipelines.
343346

344347
--offline
345348
Prevents Cargo from accessing the network for any reason. Without
@@ -356,6 +359,9 @@ OPTIONS
356359
May also be specified with the net.offline config value
357360
<https://doc.rust-lang.org/cargo/reference/config.html>.
358361

362+
--frozen
363+
Equivalent to specifying both --locked and --offline.
364+
359365
Common Options
360366
+toolchain
361367
If Cargo has been installed with rustup, and the first argument to

src/doc/man/generated_txt/cargo-generate-lockfile.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ OPTIONS
4646
Path to the Cargo.toml file. By default, Cargo searches for the
4747
Cargo.toml file in the current directory or any parent directory.
4848

49-
--frozen, --locked
50-
Either of these flags requires that the Cargo.lock file be
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 Cargo
53-
from attempting to access the network to determine if it is
54-
out-of-date.
49+
--locked
50+
Asserts that the exact same dependencies and versions are used as
51+
when the existing Cargo.lock file was originally generated. Cargo
52+
will exit with an error when either of the following scenarios
53+
arises:
5554

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.
55+
o The lock file is missing.
56+
57+
o Cargo attempted to change the lock file due to a different
58+
dependency resolution.
59+
60+
It may be used in environments where deterministic builds are
61+
desired, such as in CI pipelines.
5962

6063
--offline
6164
Prevents Cargo from accessing the network for any reason. Without
@@ -72,6 +75,9 @@ OPTIONS
7275
May also be specified with the net.offline config value
7376
<https://doc.rust-lang.org/cargo/reference/config.html>.
7477

78+
--frozen
79+
Equivalent to specifying both --locked and --offline.
80+
7581
Common Options
7682
+toolchain
7783
If Cargo has been installed with rustup, and the first argument to

0 commit comments

Comments
 (0)