Skip to main content

Prerequisites

Before building IronClaw, ensure you have the following installed:

Required

  • Rust 1.85+: Install via rustup
  • WASM target: Required for building bundled channels
  • wasm-tools: Required for WASM component model

Database Options

Choose one or both:
  • PostgreSQL 15+ with pgvector extension

libSQL (For Development)

  • No installation needed - embedded database included
  • Perfect for development and testing
  • Zero-dependency local mode

Quick Setup

The fastest way to get started:
This script:
  1. Verifies rustup installation
  2. Adds the wasm32-wasip2 target
  3. Installs wasm-tools
  4. Runs cargo check to verify compilation
  5. Runs tests using libSQL (no external database needed)

Manual Build Process

1. Clone the Repository

2. Development Build

Build with default features (PostgreSQL + libSQL):
The binary will be at target/debug/ironclaw.

3. Release Build

Build optimized binary:
The binary will be at target/release/ironclaw.

4. Run the Binary

Build Features

IronClaw supports multiple feature flags for different configurations.

Default Features

Includes:
  • postgres: PostgreSQL database support
  • libsql: Embedded database support
  • html-to-markdown: HTML content conversion

PostgreSQL Only

libSQL Only (Embedded)

All Features

Building WASM Channels

IronClaw bundles WASM channels directly into the binary. After modifying channel source code, rebuild them:

Build Specific Channel

Build All Channels

Use the convenience script:
This script:
  1. Builds all bundled channels in channels-src/
  2. Builds IronClaw with --release
  3. Outputs binary to target/release/ironclaw

Build Configuration

Cargo.toml Overview

Key configuration from Cargo.toml:

Build Profiles

Development (default)

  • Fast compilation
  • Debug symbols included
  • No optimizations

Release

  • Full optimizations
  • Stripped debug symbols
  • Slower compilation

Distribution

  • Used by cargo-dist for releases
  • Thin LTO for smaller binaries
  • Inherits from release profile

Platform-Specific Builds

macOS

Linux

Windows

Cross-Compilation

For cross-compilation, use cross:

Troubleshooting

Missing wasm32-wasip2 Target

Error: error: can't find target wasm32-wasip2 Solution:

wasm-tools Not Found

Error: Build script fails with “wasm-tools not found” Solution:

PostgreSQL Connection Failed

Error: could not connect to server Solution:

pgvector Extension Missing

Error: extension "vector" is not available Solution:

OpenSSL Errors (Linux)

Error: could not find system library 'openssl' Solution:

Compilation Memory Issues

Error: Compiler runs out of memory Solution:

Linker Errors on macOS

Error: ld: library not found Solution:

Build Scripts

IronClaw includes convenience scripts for common build tasks:

dev-setup.sh

Complete development environment setup:
  • Checks dependencies
  • Adds WASM targets
  • Installs wasm-tools
  • Runs initial build and tests

build-all.sh

Full release build with channels:
  • Builds all WASM channels
  • Builds IronClaw with --release
  • Outputs to target/release/ironclaw

Build Time Optimization

Use Cargo Cache

Incremental Compilation

Enabled by default for debug builds:

Parallel Builds

Maximize CPU usage:

Verifying Your Build

Check Version

Run Tests

See Running Tests for detailed testing guide.

Run the REPL

You should see the IronClaw interactive prompt.

Next Steps

After building successfully:
  1. Configure IronClaw: Run ironclaw onboard for setup wizard
  2. Run Tests: See Running Tests
  3. Start Contributing: Read Contributing Guide
  4. Check Feature Parity: Review Feature Parity

Additional Resources