Hirevo / alexandrie

An alternative crate registry, implemented in Rust.
https://hirevo.github.io/alexandrie/
Apache License 2.0
493 stars 55 forks source link

Support for the `sparse-index` RFC #158

Open Hirevo opened 1 year ago

Hirevo commented 1 year ago

This PR implements Cargo's new sparse-index RFC (RFC #2789), which has become stable since Rust 1.68 (March 9th, 2023).

Cargo plans to make the use of this new protocol be the default for crates.io in Rust 1.70 (June 1st, 2023).
Because of this, I predict users to start to expect every registry to behave that way quite soon, if it isn't already the case.

This protocol makes working with registries with a very large crate index way snappier for users, because cargo can selectively request the metadata for the crates it is specifically interested in for the current operation it is doing, instead of having to bring its local cloned copy of the index up-to-date using git, which can take a significant amount of time for a large crate index, or when the local clone hasn't been updated for a while and the crate index has been very active.

The routes for the sparse index API are all under the /api/v1/sparse/ base path.

The Indexer trait has been extended a bit, notably to allow retrieving the crate configuration file.

Task-list before merging