Skip to content

add more details about cargo fetch and when it will regen cargo.lock #15483

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glitch003
Copy link

What does this PR try to resolve?

I found the docs on cargo fetch unclear with respect to whether or not it will regenerate the Cargo.lock file. This PR just adds some clarity on when it will actually rebuild it.

How should we test and review this PR?

Just read the docs change and see if it makes sense or needs to be rewritten.

@rustbot
Copy link
Collaborator

rustbot commented May 2, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 2, 2025
If the lock file is not compatible with the current `Cargo.toml`, then this
command will initiate dependency resolution from the current `Cargo.toml` file,
and update the lock file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://doc.rust-lang.org/nightly/cargo/commands/cargo-fetch.html#option-cargo-fetch---locked

This is mentioned in --locked flag. Unsure if we need to emphasize it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if we change something, we should probably think holistically. This isn't the only command like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants