Skip to content

Commit

Permalink
Auto merge of #13665 - weihanglo:locked-frozen, r=<try>
Browse files Browse the repository at this point in the history
docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile
  • Loading branch information
bors committed Mar 28, 2024
2 parents 07253b7 + 0233632 commit 9d3403a
Show file tree
Hide file tree
Showing 109 changed files with 1,239 additions and 704 deletions.
6 changes: 3 additions & 3 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,17 +640,17 @@ See '<cyan,bold>cargo help</> <cyan><<command>></>' for more information on a sp
.value_parser(clap::builder::ValueParser::path_buf()),
)
.arg(
flag("frozen", "Require Cargo.lock and cache to be up-to-date")
flag("locked", "Ensure the exact dependency versions in Cargo.lock is used")
.help_heading(heading::MANIFEST_OPTIONS)
.global(true),
)
.arg(
flag("locked", "Require Cargo.lock to be up-to-date")
flag("offline", "Run without accessing the network")
.help_heading(heading::MANIFEST_OPTIONS)
.global(true),
)
.arg(
flag("offline", "Run without accessing the network")
flag("frozen", "Equivalent to specifying both --locked and --offline")
.help_heading(heading::MANIFEST_OPTIONS)
.global(true),
)
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,19 @@ OPTIONS
-p spec, --package spec
Add dependencies to only the specified package.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-bench.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-clean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-fetch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-fix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
24 changes: 15 additions & 9 deletions src/doc/man/generated_txt/cargo-generate-lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,19 @@ OPTIONS
Path to the Cargo.toml file. By default, Cargo searches for the
Cargo.toml file in the current directory or any parent directory.

--frozen, --locked
Either of these flags requires that the Cargo.lock file be
up-to-date. If the lock file is missing, or it needs to be updated,
Cargo will exit with an error. The --frozen flag also prevents Cargo
from attempting to access the network to determine if it is
out-of-date.
--locked
Ensures that Cargo uses the exact version of every dependency
captured in the existing Cargo.lock file. Cargo will exit with an
error when either of the following scenarios arises:

These may be used in environments where you want to assert that the
Cargo.lock file is up-to-date (such as a CI build) or want to avoid
network access.
o The lock file is missing.

o The dependency resolution has changed, often caused by modifying
dependencies in the Cargo.toml file.

It may be used in environments where you want to assert that the
Cargo.lock file is up-to-date for reproducibility reasons, such as
in a CI build.

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

--frozen
Equivalent to specifying both --locked and --offline.

Common Options
+toolchain
If Cargo has been installed with rustup, and the first argument to
Expand Down
Loading

0 comments on commit 9d3403a

Please sign in to comment.