-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: clarify --locked
ensures Cargo uses dependency versions in lockfile
#13665
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not too happy with "Cargo uses the exact version of every dependency", which optional dependencies are not always used. Suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too mature in my thinking, as I understand the function of this option is to lock the exact version of a dependency at build or others. So, would it be possible to describe it as: Locking the exact version of every dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure but "locking" sounds like Cargo will lock something but this is Cargo being locked to Cargo.lock
--locked
is for ensuring Cargo uses dependency versions in lockfile--locked
ensures Cargo uses dependency versions in lockfile
This seems to be a spurious network error. @bors try |
docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile
☀️ Try build successful - checks-actions |
Had a similar spurious error yesterday. btw in the github actions view, you can tell it to re-run failed jobs. |
0233632
to
aa658ba
Compare
from attempting to access the network to determine if it is | ||
out-of-date. | ||
--locked | ||
Asserts that the exact same dependencies and versions are used as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shamelessly copied from
Lines 114 to 115 in 07253b7
by ensuring that the exact same dependencies and versions are used as when the | |
`Cargo.lock` file was originally generated. |
aa658ba
to
c42c19b
Compare
c42c19b
to
26b2e74
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Update cargo 8 commits in 499a61ce7a0fc6a72040084862a68b2603e770e8..a59aba136aab5510c16b0750a36cbd9916f91796 2024-03-26 04:17:04 +0000 to 2024-03-28 21:21:41 +0000 - refactor(package): Simplify getting of published Manifest (rust-lang/cargo#13666) - fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces (rust-lang/cargo#13664) - docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile (rust-lang/cargo#13665) - RUSTC_WORKSPACE_WRAPPER: clarify docs (rust-lang/cargo#13648) - fix(add): Preserve comments when updating simple deps (rust-lang/cargo#13655) - fix(generate-lockfile): hold lock before querying index (rust-lang/cargo#13657) - test: Add asserts to catch BorrowMutError's (rust-lang/cargo#13651) - Publish test crates (rust-lang/cargo#13418) r? ghost
Update cargo 8 commits in 499a61ce7a0fc6a72040084862a68b2603e770e8..a59aba136aab5510c16b0750a36cbd9916f91796 2024-03-26 04:17:04 +0000 to 2024-03-28 21:21:41 +0000 - refactor(package): Simplify getting of published Manifest (rust-lang/cargo#13666) - fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces (rust-lang/cargo#13664) - docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile (rust-lang/cargo#13665) - RUSTC_WORKSPACE_WRAPPER: clarify docs (rust-lang/cargo#13648) - fix(add): Preserve comments when updating simple deps (rust-lang/cargo#13655) - fix(generate-lockfile): hold lock before querying index (rust-lang/cargo#13657) - test: Add asserts to catch BorrowMutError's (rust-lang/cargo#13651) - Publish test crates (rust-lang/cargo#13418) r? ghost
The current audit action regenerates the lock file which may hide vulnerabilities in our binaries. Ensure binaries are built with committed lock file by adding the `--locked` flag. Note the `--locked` flag is currently documented in a confusing way in `cargo --help`. A fix for that has been merged into cargo recently: rust-lang/cargo#13665
* Run cargo audit on committed Cargo.lock The current audit action regenerates the lock file which may hide vulnerabilities in our binaries. Ensure binaries are built with committed lock file by adding the `--locked` flag. Note the `--locked` flag is currently documented in a confusing way in `cargo --help`. A fix for that has been merged into cargo recently: rust-lang/cargo#13665 * Add --locked to cargo test invocations
What does this PR try to resolve?
Fixes #11143
This is an attempt to remove the
up-to-date
mentioned in--locked
.Up-to-date is quite confusing, especially when MSRV resolution is out,
dependency version may lag behind more often.
--frozen
is now documented as an equivalent of--locked
+--offline
.How should we test and review this PR?
Additional information