Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Commit a342194

Browse files
committed
docs: add binary distribution reference and expand installation options
Add guides/12_binary_distribution.md documenting release artifact structure, target platforms, archive contents, plugin versioning, and packaging guidelines for downstream distributors (re: leo#29337 section 5, leo#29355). Expand the installation page with a `cargo binstall` tab and rewrite the pre-built binaries tab to cover all 5 supported targets with the new per-crate artifact naming convention. Update plugin docs and guides overview with cross-links to the new page.
1 parent 54c4d15 commit a342194

4 files changed

Lines changed: 163 additions & 18 deletions

File tree

documentation/cli/18_plugins.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ If the plugin binary is not found, Leo prints an error:
5959

6060
### Installing Plugins
6161

62-
Plugins can be installed via `cargo install`:
62+
Plugins can be installed via `cargo install` or `cargo binstall`:
6363

6464
```bash
6565
cargo install leo-fmt leo-lsp
66+
# or, to download pre-built binaries:
67+
cargo binstall leo-fmt leo-lsp
6668
```
6769

68-
Pre-built binaries are also available from [Leo releases](https://github.com/ProvableHQ/leo/releases). Release archives include plugin binaries alongside `leo`.
70+
Pre-built binaries are also available from [Leo releases](https://github.com/ProvableHQ/leo/releases). Each plugin crate is released independently under its own git tag (e.g. `leo-fmt-v1.0.0`).
6971

70-
:::note
71-
Plugin distribution is evolving. Tag-triggered releases and `cargo binstall` support are in progress. See [Leo #29355](https://github.com/ProvableHQ/leo/pull/29355) for the latest details.
72-
:::
72+
For details on release artifacts, target platforms, and packaging guidelines, see the [Binary Distribution Reference](../guides/12_binary_distribution.md).
7373

7474
Running `leo update` will also attempt to update bundled plugins like `leo-fmt` on a best-effort basis.
7575

documentation/getting_started/01_installation.md

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ If you'd like to try Leo without installing it locally on your machine, check ou
1818
<Tabs defaultValue="cargo"
1919
values={[
2020
{ label: 'Cargo', value: 'cargo' },
21+
{ label: 'cargo binstall', value: 'binstall' },
2122
{ label: 'Pre-Built Binaries', value: 'prebuilt' },
2223
{ label: 'Build from Source', value: 'source' },
2324
]}>
@@ -35,27 +36,71 @@ cargo install leo-lang leo-fmt
3536

3637
This will install the `leo` and `leo-fmt` executables at `~/.cargo/bin/`.
3738
</TabItem>
38-
<TabItem value="prebuilt">
39+
<TabItem value="binstall">
3940

40-
## MacOS (Apple Silicon):
41+
## Install `cargo-binstall`
4142

42-
1. **[Download Leo for Apple Silicon (MacOS)](https://github.com/ProvableHQ/leo/releases/latest/download/leo.zip)**
43-
2. Extract the `.zip` file
44-
3. Open a terminal and navigate to the extracted directory.
45-
4. Run `chmod +x leo leo-fmt` to make the files executable
46-
5. Move both binaries to `/usr/local/bin` to use them system wide.
43+
[`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall) downloads pre-compiled binaries instead of building from source, cutting install time from minutes to seconds.
4744

48-
mv leo leo-fmt /usr/local/bin
45+
```bash
46+
cargo install cargo-binstall
47+
```
4948

50-
6. Run `leo --version` to confirm installation
49+
## Install Leo
5150

52-
:::note
53-
Release archives now include plugin binaries (such as `leo-fmt`) alongside `leo`. Distribution details are subject to change - see [Leo #29355](https://github.com/ProvableHQ/leo/pull/29355).
51+
```bash
52+
cargo binstall leo-lang leo-fmt
53+
```
54+
55+
To install a specific version:
56+
57+
```bash
58+
cargo binstall leo-lang@4.0.1 leo-fmt@1.0.0
59+
```
60+
61+
:::tip
62+
If no pre-built binary is available for your platform, `cargo binstall` falls back to building from source automatically.
5463
:::
5564

56-
## Other Platforms:
65+
</TabItem>
66+
<TabItem value="prebuilt">
67+
68+
## Download Pre-Built Binaries
69+
70+
Pre-built binaries are available for every release from [GitHub Releases](https://github.com/ProvableHQ/leo/releases).
71+
72+
Each release publishes a ZIP archive per platform:
5773

58-
- **[Browse all Leo releases](https://github.com/ProvableHQ/leo/releases)**
74+
| Platform | Target |
75+
|---|---|
76+
| Linux (x86_64, glibc) | `x86_64-unknown-linux-gnu` |
77+
| Linux (x86_64, musl) | `x86_64-unknown-linux-musl` |
78+
| macOS (Intel) | `x86_64-apple-darwin` |
79+
| macOS (Apple Silicon) | `aarch64-apple-darwin` |
80+
| Windows (x86_64) | `x86_64-pc-windows-msvc` |
81+
82+
Archives are named `leo-lang-v{version}-{target}.zip` (e.g. `leo-lang-v4.0.1-aarch64-apple-darwin.zip`).
83+
84+
## Install
85+
86+
1. Download the ZIP for your platform from the [latest release](https://github.com/ProvableHQ/leo/releases).
87+
2. Extract the archive.
88+
3. On macOS/Linux, make the binaries executable and move them onto your PATH:
89+
90+
```bash
91+
chmod +x leo leo-fmt
92+
mv leo leo-fmt /usr/local/bin/
93+
```
94+
95+
4. Verify the installation:
96+
97+
```bash
98+
leo --version
99+
```
100+
101+
:::note
102+
Plugin binaries such as `leo-fmt` are released separately under their own crate tags (e.g. `leo-fmt-v1.0.0`). Download the matching plugin archives from the same [releases page](https://github.com/ProvableHQ/leo/releases).
103+
:::
59104

60105
</TabItem>
61106
<TabItem value="source">
@@ -98,3 +143,7 @@ leo
98143

99144
</TabItem>
100145
</Tabs>
146+
147+
---
148+
149+
For distribution maintainers and detailed artifact information, see the [Binary Distribution Reference](../guides/12_binary_distribution.md).

documentation/guides/00_overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ There's a lot to learn about Leo! To help tame the complexity, we've put togethe
3232

3333
- [**ABI Generation**](./10_abi.md) - Learn about the ABI format and type lowering for SDK integration.
3434

35+
- [**Binary Distribution Reference**](./12_binary_distribution.md) - Release artifacts, target platforms, and packaging guidelines for distributors.
36+
3537
## Migration
3638

3739
- [**Migrating from Leo 3.5 to 4.0**](./11_migration_3_5_to_4_0.md) - A complete guide to updating your programs for Leo 4.0.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
id: binary-distribution
3+
title: Binary Distribution Reference
4+
sidebar_label: Binary Distribution
5+
---
6+
7+
[general tags]: # "guides, packaging, distribution, releases, binaries"
8+
9+
# Binary Distribution Reference
10+
11+
This page documents Leo's release artifact structure and packaging guidelines. It is intended for community packagers, downstream distributors, and advanced users who want to understand how Leo binaries are published.
12+
13+
For installation instructions, see [Getting Started - Installation](../getting_started/01_installation.md).
14+
15+
## Release Model
16+
17+
Leo uses a per-crate release model. Each publishable crate in the [Leo repository](https://github.com/ProvableHQ/leo) is released independently via git tags matching the pattern `{crate-name}-v{version}` (e.g. `leo-lang-v4.0.1`, `leo-fmt-v1.0.0`).
18+
19+
When a tag is pushed, CI builds cross-platform binaries and publishes them as a GitHub Release under that tag.
20+
21+
## Release URL Pattern
22+
23+
GitHub Releases are published at:
24+
25+
```
26+
https://github.com/ProvableHQ/leo/releases/tag/{crate-name}-v{version}
27+
```
28+
29+
Each release contains one ZIP artifact per supported target, named:
30+
31+
```
32+
{crate-name}-v{version}-{target}.zip
33+
```
34+
35+
For example, `leo-lang-v4.0.1` produces:
36+
37+
- `leo-lang-v4.0.1-x86_64-unknown-linux-gnu.zip`
38+
- `leo-lang-v4.0.1-x86_64-unknown-linux-musl.zip`
39+
- `leo-lang-v4.0.1-x86_64-apple-darwin.zip`
40+
- `leo-lang-v4.0.1-aarch64-apple-darwin.zip`
41+
- `leo-lang-v4.0.1-x86_64-pc-windows-msvc.zip`
42+
43+
## Supported Targets
44+
45+
| Target Triple | OS | Architecture | Notes |
46+
|---|---|---|---|
47+
| `x86_64-unknown-linux-gnu` | Linux | x86_64 | Dynamically linked against glibc |
48+
| `x86_64-unknown-linux-musl` | Linux | x86_64 | Statically linked (Alpine, scratch containers, etc.) |
49+
| `x86_64-apple-darwin` | macOS | Intel | |
50+
| `aarch64-apple-darwin` | macOS | Apple Silicon | |
51+
| `x86_64-pc-windows-msvc` | Windows | x86_64 | |
52+
53+
## Archive Contents
54+
55+
Each ZIP contains all binaries produced by the crate. Current crates and their binaries:
56+
57+
| Crate | Binary | Description |
58+
|---|---|---|
59+
| `leo-lang` | `leo` | The Leo compiler and CLI |
60+
| `leo-fmt` | `leo-fmt` | Leo source code formatter |
61+
| `leo-lsp` | `leo-lsp` | Language server for editor integration |
62+
63+
Future plugin crates will follow the same pattern.
64+
65+
## Plugin Versioning
66+
67+
Plugin crates (`leo-fmt`, `leo-lsp`) are versioned independently from `leo-lang`. Each crate has its own git tag and release cadence, allowing tooling updates to ship without requiring a new compiler release.
68+
69+
When packaging Leo, ensure the installed plugin versions are compatible with the installed `leo-lang` version.
70+
71+
:::note
72+
A machine-readable `releases.toml` manifest is planned to track version compatibility between `leo-lang` and its plugins. Until it is available, consult the [Leo releases page](https://github.com/ProvableHQ/leo/releases) for release notes on compatible version sets.
73+
:::
74+
75+
## Packaging Guidelines
76+
77+
Downstream packages (Homebrew taps, AUR PKGBUILDs, distribution packages, etc.) should follow these guidelines:
78+
79+
- **Install all binaries together.** A complete Leo installation includes `leo`, `leo-fmt`, and `leo-lsp`. Users expect the full toolchain.
80+
- **Place all binaries on `PATH`.** Leo discovers plugins by searching `PATH` for executables matching the `leo-<name>` convention.
81+
- **Preserve the `leo-<name>` naming convention.** Plugin dispatch depends on it - renaming `leo-fmt` to something else will break `leo fmt`.
82+
- **Track compatible versions across crates.** Since crates are released independently, packages should pin to known-compatible version sets.
83+
84+
## `cargo binstall` Support
85+
86+
Each binary crate includes `[package.metadata.binstall]` configuration in its `Cargo.toml`, pointing to the GitHub Release artifact URL template. This means `cargo binstall` resolves the correct platform ZIP automatically:
87+
88+
```bash
89+
cargo binstall leo-lang
90+
cargo binstall leo-fmt
91+
cargo binstall leo-lsp
92+
```
93+
94+
If no pre-built binary is available for the user's platform, `cargo binstall` falls back to building from source via `cargo install`.

0 commit comments

Comments
 (0)