#cargo-subcommand #cargo #binary #pre-built

app cargo-prebuilt

Download prebuilt crate binaries for many different platforms

24 releases

0.7.5 Dec 1, 2024
0.7.4-dev.0 Oct 26, 2024
0.7.3 Sep 22, 2024
0.7.2 Jul 27, 2024
0.2.1 Nov 13, 2022

#44 in Cargo plugins

Download history 274/week @ 2024-09-22 15/week @ 2024-09-29 9/week @ 2024-10-06 13/week @ 2024-10-13 38/week @ 2024-10-20 60/week @ 2024-10-27 37/week @ 2024-11-03 1/week @ 2024-11-10 2/week @ 2024-11-17 159/week @ 2024-12-01

162 downloads per month

MIT license

76KB
1.5K SLoC

cargo-prebuilt

Rust Build and Test Rust Checks Crates.io rustc-msrv

Download prebuilt binaries of some crate.io crates.

See supported targets, a list of prebuilt crates, and the official index here.

(Some targets may not be prebuilt for some crates).

Request a crate to be added to the official index here.

See the currently supported versions here

How to Use

Cargo prebuilt overwrites existing binaries by default. To stop this use the -s flag, --safe flag, or add safe = true to your config file.

To download a crate: cargo prebuilt CRATE_NAME

To download multiple crates: cargo prebuilt CRATE_1,CRATE_2,CRATE_3,...

To download a version of a crate: cargo prebuilt CRATE_NAME@VERSION

To download multiple crates with versions: cargo prebuilt CRATE_1@V1,CRATE_2,CRATE_3@V3,...

Need help? Try: cargo prebuilt --help or see Config Info

Installation

More ways and how to verify your download here.

  • You can download the latest prebuilt binaries of cargo-prebuilt here.
  • Cargo install: cargo install cargo-prebuilt
  • Cargo prebuilt: cargo prebuilt cargo-prebuilt
  • Cargo binstall: cargo binstall cargo-prebuilt --no-confirm
  • Cargo quickinstall: cargo quickinstall cargo-prebuilt
  • Install script (Unix platforms):
bash -c "$(curl -fsSL --tlsv1.2 https://raw.githubusercontent.com/cargo-prebuilt/cargo-prebuilt/main/scripts/install-cargo-prebuilt.sh)"

Building

(Cargo prebuilt requires either the native or rustls feature)

cargo build or for a release version cargo build --release

Events

To output events use --out.

See Events.

Reports

Reports are generated during crate build time in the index.

They are stored under $REPORTS/$CRATE/$VERSION by default.

See Report Directory ($REPORTS).

Use --report-path to change where they are stored.

Report Types

Using a custom index

GitHub public

Template (Usually out of date compared to the main index)

Your URL should be formatted like github.com/cargo-prebuilt/index. cargo-prebuilt requires HTTPS.

  • export PREBUILT_INDEX=gh-pub:$URL

  • cargo prebuilt --index=gh-pub:$URL CRATES

  • config.toml

    [key.index]
    index = "gh-pub:$URL"
    pub_key = []
    

GitHub private

Beta Feature.

Your URL should be formatted like github.com/cargo-prebuilt/index. Cargo-prebuilt requires HTTPS.

This index requires an auth token with: Repository permission -> Contents -> Read-only. Generate a token

  • export PREBUILT_INDEX=gh-pri:$URL

  • cargo prebuilt --index=gh-pri:$URL CRATES

  • config.toml

    [key.index]
    index = "gh-pri:$URL"
    pub_key = []
    auth = ""
    

Dependencies

~9–21MB
~317K SLoC