Building & Testing
Building & Testing
Section titled “Building & Testing”This page covers how to build clido from source, run the test suite, check code quality, and produce a release build.
Prerequisites
Section titled “Prerequisites”Rust toolchain
Section titled “Rust toolchain”The required toolchain version is pinned in rust-toolchain.toml at the repository root. rustup will pick this up automatically:
# Install rustup if not already installedcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# rustup reads rust-toolchain.toml on first userustc --versionSystem dependencies
Section titled “System dependencies”| Platform | Required | Purpose |
|---|---|---|
| Linux | pkg-config, libssl-dev | TLS for HTTP clients |
| macOS | Xcode Command Line Tools | Linker and system headers |
| Both | sqlite3 (usually pre-installed) | Memory and index storage |
On Ubuntu/Debian:
sudo apt install pkg-config libssl-devOn macOS:
xcode-select --installBuilding
Section titled “Building”Development build
Section titled “Development build”cargo build --workspaceThe clido binary is written to target/debug/clido.
Release build
Section titled “Release build”cargo build --workspace --release# ormake releaseThe clido binary is written to target/release/clido. Release builds have LTO enabled and produce a smaller, faster binary.
Installing locally
Section titled “Installing locally”cargo install --path crates/clido-cliThis compiles in release mode and copies clido to ~/.cargo/bin/.
Running tests
Section titled “Running tests”Full test suite
Section titled “Full test suite”cargo test --workspaceSingle crate
Section titled “Single crate”cargo test -p clido-corecargo test -p clido-agentSingle test
Section titled “Single test”cargo test -p clido-core -- config_file_exists_true_when_project_config_presentIntegration tests
Section titled “Integration tests”Integration tests live in tests/ at the workspace root:
cargo test --test '*'Some integration tests require an API key:
ANTHROPIC_API_KEY=sk-ant-... cargo test --test integrationIntegration tests that need a live API are marked #[ignore] and must be explicitly included:
ANTHROPIC_API_KEY=sk-ant-... cargo test --test integration -- --include-ignoredCode quality
Section titled “Code quality”Clippy
Section titled “Clippy”cargo clippy --workspace --all-targets -- -D warningsThe CI pipeline uses -D warnings so all lint warnings are treated as errors. Fix warnings before opening a PR.
Format
Section titled “Format”cargo fmt --allCheck only (no changes):
cargo fmt --all -- --checkBoth (pre-commit check)
Section titled “Both (pre-commit check)”cargo fmt --all -- --check && cargo clippy --workspace --all-targets -- -D warningsTest coverage
Section titled “Test coverage”Coverage reports use cargo-tarpaulin:
cargo install cargo-tarpaulincargo tarpaulin --workspace --out Html --output-dir target/coverageopen target/coverage/tarpaulin-report.html::: tip Tarpaulin does not support macOS on Apple Silicon. On macOS, use cargo-llvm-cov instead:
cargo install cargo-llvm-covcargo llvm-cov --workspace --html:::
Benchmarks
Section titled “Benchmarks”Performance-critical code in clido-context and clido-index has Criterion benchmarks:
cargo bench --workspaceResults are written to target/criterion/.
CI pipeline
Section titled “CI pipeline”GitHub Actions runs the following on every pull request:
| Job | Command | When |
|---|---|---|
| format | cargo fmt --all -- --check | Always |
| clippy | cargo clippy --workspace -- -D warnings | Always |
| test | cargo test --workspace | Always |
| test (integration) | cargo test --test '*' -- --include-ignored | With secrets |
| build (release) | cargo build --release | On merge to master |
The workflow files are in .github/workflows/.
Makefile targets
Section titled “Makefile targets”The Makefile provides convenience targets:
make build # cargo build --workspacemake release # cargo build --workspace --releasemake test # cargo test --workspacemake lint # fmt check + clippymake fmt # cargo fmt --allmake clean # cargo cleanmake install # cargo install --path crates/clido-cli --forceFeature flags
Section titled “Feature flags”clido does not currently use Cargo feature flags. All functionality is compiled into the binary.
Cross-compilation
Section titled “Cross-compilation”Cross-compilation is not officially supported but is possible with cross:
cargo install crosscross build --target aarch64-unknown-linux-gnu --release::: warning Cross-compiled binaries have not been tested in CI. If you need a specific target, please open an issue. :::