panamax-rs / panamax

Mirror rustup and crates.io repositories, for offline Rust and cargo usage.
Apache License 2.0
427 stars 45 forks source link

Feature request: Add support for sparse registry #86

Closed Christiaan676 closed 1 year ago

Christiaan676 commented 1 year ago

An update for cargo is in the works to make downloading of the index smaller and faster. This is especial important for CI jobs. It would be nice, if Panamax could support this.

Rust blog post: https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html Tracking issue: https://github.com/rust-lang/cargo/issues/9069

wcampbell0x2a commented 1 year ago

I have a small project to download a small portion of crates.io, meant to be used with the new sparse register feature. Panamax should need only a small addition for this, since the new version just needs http.

https://github.com/wcampbell0x2a/zerus

k3d3 commented 1 year ago

I'm very interested in having sparse registry support in Panamax! Like @wcampbell0x2a mentioned, I'm hoping there shouldn't be too much more than to just expose the crates.io-index directory via HTTP.

Christiaan676 commented 1 year ago

@wcampbell0x2a @k3d3 Yes, agree. Looking at the RFC, Etag or If-Modified-Since header support might be needed as well.

k3d3 commented 1 year ago

Now implemented in the panamax serve command as of v1.0.10. The sparse index is now exposed at /index/.

That means if your previous registry line in .cargo/config was:

registry = https://panamax.internal/git/crates.io.index

You will be able to use the sparse index by changing it to:

registry = sparse+https://panamax.internal/index/

I've also updated the panamax serve homepage to reflect this new URL.