From 7d0c068642c463072b18e169a4576db439a26730 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 10 May 2021 15:15:26 -0700 Subject: [PATCH] Bump index cache version. --- src/cargo/sources/registry/index.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cargo/sources/registry/index.rs b/src/cargo/sources/registry/index.rs index ae837d450d6..0be4a591f83 100644 --- a/src/cargo/sources/registry/index.rs +++ b/src/cargo/sources/registry/index.rs @@ -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> {