Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Development Setup

This page covers everything needed to build, run, and develop hoike from source.

Prerequisites

RequirementVersionNotes
Rust1.85+Edition 2024. Install via rustup.
C linkerAnyXcode CLT (macOS), build-essential (Debian/Ubuntu), gcc (Fedora/RHEL)
OpenSSL3.xFor test certificate generation only
Git2.xFor cloning

Verify your Rust toolchain:

rustc --version   # 1.85.0 or later
cargo --version

Clone and build

git clone https://github.com/czinda/hoike.git
cd hoike
cargo build --release

The workspace produces two binaries:

BinaryLocationSize
hoiketarget/release/hoike~8 MB
ahutarget/release/ahu~1 MB

For development builds (faster compilation, slower runtime):

cargo build

Workspace structure

The Cargo workspace contains six crates:

hoike/
  Cargo.toml              # Workspace root
  crates/
    ahu/                   # Bundle format (Apache-2.0 OR MIT)
      Cargo.toml
      src/
      tests/
    hoike-core/            # Shared types, config, routing (GPL-3.0+)
      Cargo.toml
      src/
      tests/
    hoike-sign/            # Response production, signing (GPL-3.0+)
      Cargo.toml
      src/
      tests/
    hoike-server/          # HTTP handlers (GPL-3.0+)
      Cargo.toml
      src/
      tests/
        conformance.rs
    hoike-gossip/          # SWIM protocol (GPL-3.0+)
      Cargo.toml
      src/
    hoike-cli/             # CLI entry points (GPL-3.0+)
      Cargo.toml
      src/
        bin/
          hoike.rs
          ahu.rs
  testdata/
    generate.rs            # Test certificate/CRL generation

Crate dependency graph

Dependencies flow downward. The ahu crate is at the bottom and has no server-side dependencies:

graph TD
    CLI[hoike-cli] --> Server[hoike-server]
    CLI --> Sign[hoike-sign]
    Server --> Core[hoike-core]
    Sign --> Core
    Server --> Gossip[hoike-gossip]
    Core --> Ahu[ahu]
    Sign --> Ahu
    style Ahu fill:#e8f5e9,stroke:#2e7d32

The green-highlighted ahu crate is the trust boundary for the dual-license split. It must never depend on tokio, hyper, axum, or PKCS#11.

The dual-DER-version note

The workspace uses two versions of the RustCrypto der crate:

Crateder versionReason
x509-ocsp 0.2.xder 0.7OCSP request/response parsing (tracks x509-cert 0.2)
ahuder 0.8Bundle manifest and seal operations

This is intentional. The x509-ocsp crate has not yet released a version that uses der 0.8. Cargo handles the two versions transparently, but be aware of this when working on code that bridges the two:

  • Types from der 0.7 are not interchangeable with types from der 0.8
  • Conversion between the two versions requires re-encoding as DER bytes and re-parsing
  • The bridge code lives in hoike-core where the two versions meet

If x509-ocsp releases a der 0.8 compatible version, the workspace should be updated to unify on a single version.

Building individual crates

Build only the bundle library:

cargo build --release -p ahu

The ahu crate supports --no-default-features for minimal builds:

cargo build --release -p ahu --no-default-features

Build without gossip support:

cargo build --release -p hoike-cli --no-default-features

Generating API documentation

cargo doc --workspace --no-deps --open

This builds rustdoc for all six crates and opens the result in a browser.

Running tests

Run the full test suite:

cargo test --workspace

See the Testing page for detailed test categories and options.

Development tools

Recommended but not required:

ToolPurposeInstall
cargo-watchAuto-rebuild on savecargo install cargo-watch
cargo-nextestFaster test runner with better outputcargo install cargo-nextest
mdbookBuild the documentation bookcargo install mdbook
mdbook-mermaidMermaid diagram support for mdbookcargo install mdbook-mermaid

Development workflow with cargo-watch:

# Rebuild on change
cargo watch -x build

# Run tests on change
cargo watch -x 'test --workspace'

Environment variables

VariableDefaultDescription
HOIKE_LOGinfoLog level (trace, debug, info, warn, error)
HOIKE_CONFIGNonePath to configuration file
RUST_BACKTRACE0Set to 1 for backtraces on panic

IDE setup

hoike uses standard Rust tooling. Any editor with rust-analyzer support works well:

  • VS Code: Install the rust-analyzer extension
  • Neovim: Use nvim-lspconfig with rust_analyzer
  • IntelliJ: Use the Rust plugin

The workspace root Cargo.toml is the correct entry point for rust-analyzer. No additional configuration is needed.