Bump index cache version to deal with semver metadata version mismatch. #9476
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.
#9467 has uncovered an issue with how versions are handled in the index cache. When using a debug build of Cargo, it may panic due to the cache contents changing. The particular problem I am running into is that the index has an entry for
openssl-src 110.0.0
and110.0.0+1.1.0f
. This is due to an issue with crates.io where it allows publishing multiple versions with the same metadata (rust-lang/crates.io#1059). Cargos before #9467 would populate the index cache with two entries, both with version110.0.0
. Afterwards, there are two separate entries (110.0.0
and110.0.0+1.1.0f
).The change here is to bump the index cache version so that new versions of cargo will clear the cache, and won't trigger the assertion.
This may be a bit of a heavy-handed solution, as I think this only affects debug builds of cargo. However, I instantly started running into this problem, so I suspect it will be a real annoyance for anyone developing cargo. Happy to discuss other possible solutions.