Building from Source

## Prerequisites

  • Rust 1.95+ (rustup.rs)
  • Git
  • C compiler (for native dependencies)
    • Linux: build-essential / gcc
    • macOS: Xcode Command Line Tools (xcode-select --install)

Build

git clone https://github.com/muvon/octomind.git
cd octomind

# Debug build
cargo build

# Release build (optimized)
cargo build --release

# Binary location
./target/release/octomind --version

Development Workflow

# Check compilation (fast)
cargo check

# Run clippy (linting)
cargo clippy -- -D warnings

# Format code
cargo fmt

# Run tests
cargo test

# Run specific test
cargo test test_name

Pre-commit Hooks

Install pre-commit hooks to enforce quality before committing:

# Install pre-commit (if not installed)
pip install pre-commit

# Install hooks
pre-commit install

Checks Performed

CheckDescription
cargo fmtRust formatting
cargo clippyLinting (warnings as errors)
cargo checkCompilation
check-merge-conflictNo merge conflict markers
check-tomlValid TOML files
check-yamlValid YAML files
check-added-large-filesNo files > 1MB
trailing-whitespaceNo trailing whitespace
end-of-file-fixerFiles end with newline

Manual Execution

# Run all hooks
make pre-commit

# Or directly
pre-commit run --all-files

Bypassing (discouraged)

git commit --no-verify

Release Build Optimizations

The release profile in Cargo.toml:

  • LTO enabled (link-time optimization)
  • Single codegen unit
  • opt-level = "z" (optimize for size)
  • panic = "abort" (smaller binary)
  • Symbol stripping

Cross-Platform Notes

  • Linux: Landlock sandbox support (kernel 5.13+)
  • macOS: Seatbelt sandbox support
  • Windows: %LOCALAPPDATA% for data directory