zerus

github crates.io docs.rs build status

Lightweight binary to download only project required crates for offline crates.io mirror

Requirements

The example use case is with nightly feature sparse-registry. However, a crates.io-index mirror git repo can be hosted on its on and point towards this repo with stable rust.

Build zerus

Either build from published source in crates.io. $ cargo install zerus --locked

Or download from github releases.

Usage

```console Usage: zerus [WORKSPACE]...

Arguments: new directory to contain offline mirror crate files [WORKSPACE]... list of Cargo.toml files to vendor depends

Options: -h, --help Print help information ```

Example: ```console $ zerus new-mirror ../deku/Cargo.toml ../adsb_deku/Cargo.toml $ cd new-mirror $ git clone https://github.com/rust-lang/crates.io-index

configure crates.io-index to point to our host

$ cat crates.io-index/config.json { "dl": "http://[IP]/crates/{prefix}/{crate}/{version}/{crate}-{version}.crate", "api": "http://[IP]/crates" } ```

Serve mirror

Use miniserve.

Build with mirror

Add the following to the .cargo/config file(replacing IP with your ip). ``` [registries.crates-io] protocol = "sparse"

[source.zerus] registry = "sparse+http://[IP]/crates.io-index/"

[source.crates-io] replace-with = "zerus" ```