-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Clarify Implications of Cargo Yank #11071
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9065c87
Update cargo-yank.md
tustvold 17c711c
Review feedback
tustvold aa1f590
Tweak wording
tustvold e48b16f
Remove empty files
tustvold af6b722
Fix copypasta
tustvold d227ad6
Review feedback
tustvold 1cba8b7
Fix typo
tustvold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,39 @@ The yank command removes a previously published crate's version from the | |
server's index. This command does not delete any data, and the crate will | ||
still be available for download via the registry's download link. | ||
|
||
Note that existing crates locked to a yanked version will still be able to | ||
download the yanked version to use it. Cargo will, however, not allow any new | ||
crates to be locked to any yanked version. | ||
Crates should only be yanked in exceptional circumstances, for example, license/copyright issues, accidental | ||
inclusion of [PII](https://en.wikipedia.org/wiki/Personal_data), credentials, etc... In the case of security | ||
vulnerabilities, [RustSec](https://rustsec.org/) is typically a less disruptive mechanism to inform users | ||
and encourage them to upgrade, and avoids the possibility of significant downstream disruption irrespective | ||
of susceptibility to the vulnerability in question. | ||
|
||
Cargo will not use a yanked version for any new project or checkout without a | ||
pre-existing lockfile, and will generate an error if there are no longer | ||
any compatible versions for your crate. | ||
|
||
For example, the `foo` crate published version `0.22.0` and another crate `bar` | ||
declared a dependency on version `foo = 0.22`. Now `foo` releases a new, but | ||
not semver compatible, version `0.23.0`, and finds a critical issue with `0.22.0`. | ||
If `0.22.0` is yanked, no new project or checkout without an existing lockfile will be | ||
able to use crate `bar` as it relies on `0.22`. | ||
|
||
In this case, the maintainers of `foo` should first publish a semver compatible version | ||
such as `0.22.1` prior to yanking `0.22.0` so that `bar` and all projects that depend | ||
on `bar` will continue to work. | ||
Comment on lines
+34
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This paragraph concludes the example really well, thought it feels like somewhat a duplicate of line 49-50. A challenge in documentation is putting the right amount. Could we find a way to merge them and make it more concise? It is not a blocker on merging this PR though. |
||
|
||
As another example, consider a crate `bar` with published versions `0.22.0`, `0.22.1`, | ||
`0.22.2`, `0.23.0` and `0.24.0`. The following table identifies the versions | ||
cargo could use in the absence of a lockfile for different SemVer requirements, | ||
following a given release being yanked: | ||
|
||
| Yanked Version / SemVer requirement | `bar = "0.22.0"` | `bar = "=0.22.0"` | `bar = "0.23.0"` | | ||
|-------------------------------------|-------------------------------------------|-------------------|------------------| | ||
| `0.22.0` | Use either `0.22.1` or `0.22.2` | **Return Error** | Use `0.23.0` | | ||
| `0.22.1` | Use either `0.22.0` or `0.22.2` | Use `0.22.0` | Use `0.23.0` | | ||
| `0.23.0` | Use either `0.22.0`, `0.21.0` or `0.22.2` | Use `0.22.0` | **Return Error** | | ||
|
||
A common workflow is to yank a crate having already published a semver compatible version, | ||
to reduce the probability of preventing dependent crates from compiling. | ||
|
||
This command requires you to be authenticated with either the `--token` option | ||
or using {{man "cargo-login" 1}}. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
1 change: 1 addition & 0 deletions
1
tests/testsuite/init/mercurial_autodetect/in/.hg/wcache/checklink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
checklink-target |
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
tests/testsuite/init/simple_hg_ignore_exists/in/.hg/wcache/checklink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
checklink-target |
Empty file.
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How do you feel putting them in the end of this
DESCRIPTION
section, under a subsection heading like### When to yank
or something better?Just trying to make it look less lengthy and more organized. The content itself is really well-written! Thank you!