Environment:AI Shell Team Aish Rust Toolchain
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Build_System |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Rust 1.89+ (toolchain pinned to 1.95.0), edition 2021, with musl cross-compilation support for static Linux binaries.
Description
The aish workspace is a 19-crate Rust project using edition 2021. The root `Cargo.toml` sets `rust-version = "1.89"` as the minimum supported Rust version (MSRV), while `rust-toolchain.toml` pins the actual build toolchain to channel `1.95.0` with a `minimal` profile plus `clippy` and `rustfmt` components. The resolver is set to `"2"` (feature unification). Release builds target `x86_64-unknown-linux-musl` by default (`build.sh`) to produce a fully static binary, requiring `musl-tools` (or `musl-gcc`) on Linux.
Usage
Use this environment for any build, test, or CI task. It is the mandatory prerequisite for compiling any of the 19 workspace crates and for running `cargo build --release`, `cargo test`, or `cargo clippy`.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux (primary) | macOS/WSL2 work for dev; musl cross-link is Linux-only |
| Hardware | x86_64 or aarch64 | Static musl binary targets x86_64 by default |
| Disk | 2GB+ free | `target/` directory can grow large with release + musl target |
| Build Tools | `pkg-config`, `musl-tools` | Required for musl static linking on Linux |
Dependencies
System Packages
- `rustup` (manages the 1.95.0 toolchain)
- `musl-tools` / `musl-gcc` (for `x86_64-unknown-linux-musl` target)
- `pkg-config`
- `libssl-dev` / `libdbus-1-dev` (optional, if not using bundled deps)
Rust Crates (workspace)
- `tokio` = 1 (features = full) — async runtime
- `reqwest` = 0.12 (features = json, stream, rustls-tls, blocking)
- `nix` = 0.29 (features = term, process, signal, fs, ioctl, poll, user)
- `libc` = 0.2
- `rusqlite` = 0.32 (features = bundled) — SQLite via bundled C source
- `crossterm` = 0.28 (features = event-stream)
- `ratatui` = 0.30
- `clap` = 4 (features = derive)
- `serde` = 1, `serde_json` = 1, `serde_yaml` = 0.9
- `regex` = 1, `tiktoken-rs` = 0.5
- `notify` = 7, `dirs` = 5
Toolchain Pin
[toolchain]
channel = "1.95.0"
profile = "minimal"
components = ["clippy", "rustfmt"]
Credentials
No secrets required for building. The `GITHUB_TOKEN` environment variable is used at runtime by the skill installer to avoid GitHub API rate limits when fetching skill repositories.
Quick Install
# Install Rust via rustup (if not already present)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# The toolchain pin is applied automatically by rustup when entering the repo.
# Add the musl target for static builds:
rustup target add x86_64-unknown-linux-musl
sudo apt-get install -y musl-tools
# Build the release binary:
./build.sh
# Or directly:
cargo build --release --target x86_64-unknown-linux-musl
Code Evidence
MSRV declaration from `Cargo.toml:28-29`:
[workspace.package]
edition = "2021"
rust-version = "1.89"
Toolchain pin from `rust-toolchain.toml:1-4`:
[toolchain]
channel = "1.95.0"
profile = "minimal"
components = ["clippy", "rustfmt"]
Musl target default and auto-install logic from `build.sh:15-39`:
TARGET="${AISH_BUILD_TARGET:-x86_64-unknown-linux-musl}"
if [[ "$TARGET" == *musl* ]]; then
if ! rustup target list --installed | grep -q "$TARGET"; then
rustup target add "$TARGET"
fi
if ! command -v musl-gcc &>/dev/null && ! dpkg -l musl-tools &>/dev/null 2>&1; then
sudo apt-get update && sudo apt-get install -y musl-tools
fi
fi
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `error: linker 'musl-gcc' not found` | musl-tools not installed | `sudo apt-get install -y musl-tools` |
| `error[E0554]` feature gate on stable | Using Rust < 1.89 | `rustup update` to at least 1.89 |
| `failed to run custom build command for openssl-sys` | System OpenSSL dev headers missing | Use `rustls-tls` feature (default) or `apt install libssl-dev` |
| `error: package 'cliclack' not found` | Git patch crate not fetched | Ensure network access for `[patch.crates-io]` git dependency |
Compatibility Notes
- macOS: Development works but musl static linking requires a cross toolchain (`brew install filosottile/musl-cross/musl-cross`).
- Windows (native): Not supported; PTY layer relies on POSIX (`fork`, `openpty`, `setsid`). Use WSL2.
- musl target: The bundled `rusqlite` crate compiles SQLite from C source, so a C compiler is required even with musl.
- cliclack patch: The workspace patches `cliclack` from a forked GitHub repo (`AI-Shell-Team/cliclack`, rev `1636d63`); network access is required for first build.