cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

Preliminary support for sparse indices

Open MoSal opened this issue 2 years ago • 7 comments

This will forever be a draft, unless someone adopts it of course. But I hope it will help moving things forward.

This implements preliminary support for sparse indices.

  • All deps are updated/upgraded to latest versions.
  • Git index support removed. Only sparse indices work.
  • Tests are broken since they assume git indices.
  • Crate info is not fetched in parallel for the sake of simplicity. Fetching is still very fast despite that (< 4s for cargo-edit, almost instantaneous with --offline).

ureq was already a dependency for some reason. So I used it after enabling the "gzip" feature.

Note to implementers regarding gix-based GitIndex from the latest crates_index:

  • Some tests fail with hash mismatches.
  • A test fails because the order of output is different (I think).
  • Not sure how locking works with gix.

I didn't inspect those issues further, as I just wanted to make sparse indices work for me.

Related issues: #841, #865, #868, possibly #869

MoSal avatar Aug 22 '23 19:08 MoSal

git index support should probably be supported by reading the cargo config value, but it seems like a pain to find the config path so I can understand why you wouldn't want to add it, lol

amsam0 avatar Aug 23 '23 01:08 amsam0

Something to keep in mind is that the FCP is about to close on merging parts of cargo-upgrade into cargo-update after which I'll get to work on doing that and it will be available in a nightly.

epage avatar Aug 23 '23 13:08 epage

@epage

Sounds good.

MoSal avatar Aug 23 '23 15:08 MoSal

@epage do you have a link to the proposal you mentioned? Wondering what the exact change is but can't find anything.

tgross35 avatar Nov 14 '23 19:11 tgross35

https://github.com/rust-lang/cargo/issues/12425

I have a got a lot of the peripheral aspects done but haven't gotten to the core of it yet

epage avatar Nov 14 '23 19:11 epage

does this mean that cargo upgrade is broken for everyone that installed cargo/rust after the new registry format was added? how can I use the old registry format?

dvc94ch avatar Mar 18 '24 13:03 dvc94ch

what's the alternative right now? installing vscode and the rustrover plugin to update incompatible dependencies?

dvc94ch avatar Mar 18 '24 13:03 dvc94ch