Skip to content
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

Bump index cache version to deal with semver metadata version mismatch. #9476

Merged
merged 1 commit into from
May 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/cargo/sources/registry/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,16 @@ impl Summaries {
// * `2`: Added the "index format version" field so that if the index format
// changes, different versions of cargo won't get confused reading each
// other's caches.

const CURRENT_CACHE_VERSION: u8 = 2;
// * `3`: Bumped the version to work around a issue where multiple versions of
// a package were published that differ only by semver metadata. For
// example, openssl-src 110.0.0 and 110.0.0+1.1.0f. Previously, the cache
// would be incorrectly populated with two entries, both 110.0.0. After
// this, the metadata will be correctly included. This isn't really a format
// change, just a version bump to clear the incorrect cache entries. Note:
// the index shouldn't allow these, but unfortunately crates.io doesn't
// check it.

const CURRENT_CACHE_VERSION: u8 = 3;

impl<'a> SummariesCache<'a> {
fn parse(data: &'a [u8], last_index_update: &str) -> CargoResult<SummariesCache<'a>> {
Expand Down