]> git.proxmox.com Git - cargo.git/commit
Auto merge of #9476 - ehuss:index-cache-bump, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 10 May 2021 23:04:32 +0000 (23:04 +0000)
committerbors <bors@rust-lang.org>
Mon, 10 May 2021 23:04:32 +0000 (23:04 +0000)
commit253fab11c32178ef159f2f2f1f52baab438f63a7
tree615de90c3ef1578fde72f878c5d100a2b562ed5c
parente5fdd481b12d24bb14b3f73ee001d86e4a44b57b
parent7d0c068642c463072b18e169a4576db439a26730
Auto merge of #9476 - ehuss:index-cache-bump, r=alexcrichton

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

#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](https://github.com/rust-lang/cargo/blob/5c455130b6001c7f54e872e161c27f6e996aff1f/src/cargo/sources/registry/index.rs#L606-L619).  The particular problem I am running into is that the index has an entry for `openssl-src 110.0.0` and `110.0.0+1.1.0f`. This is due to an issue with crates.io where it allows publishing multiple versions with the same metadata (https://github.com/rust-lang/crates.io/issues/1059).  Cargos before #9467 would populate the index cache with two entries, both with version `110.0.0`.  Afterwards, there are two separate entries (`110.0.0` and `110.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.