Skip to main content
You can build hline from source if you want to contribute, customize the tool, or run the latest development version.

Prerequisites

You need the Rust toolchain installed with the following minimum version:
  • Rust 1.78 or later
Install Rust via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Build commands

Release build

Build an optimized binary:
cargo build --release
The compiled binary will be at target/release/hline.
The release profile uses:
  • Thin LTO (lto = "thin")
  • Single codegen unit (codegen-units = 1)
  • Stripped symbols (strip = true)
This produces a smaller, faster binary optimized for distribution.

Run the binary

After building, you can run hline directly:
./target/release/hline --help
./target/release/hline --version

Run without building

Use cargo run to compile and run in one step:
cargo run
cargo run -- --file /path/to/history

Running tests

Run the test suite:
cargo test --all-targets

Quality checks

Before submitting code changes, run these checks:

Format check

cargo fmt --all -- --check
Auto-format code:
cargo fmt --all

Linting

cargo clippy --all-targets --all-features -- -D warnings
This runs the Clippy linter with all warnings treated as errors.

Local release build

Create a release artifact with checksums using the packaging script:
./scripts/release_local.sh
This will:
  1. Build hline for your current platform target
  2. Package the binary with README.md and LICENSE
  3. Create a .tar.gz archive
  4. Generate a SHA256 checksum file
Artifacts are written to the dist/ directory:
ls -lah dist

Naming format

Release archives follow this pattern:
hline-<arch>-<target>.tar.gz
hline-<arch>-<target>.tar.gz.sha256
Example:
hline-x86_64-unknown-linux-gnu.tar.gz
hline-x86_64-unknown-linux-gnu.tar.gz.sha256

Custom build target

Override the target triple:
TARGET_TRIPLE=aarch64-unknown-linux-gnu ./scripts/release_local.sh

Build docs developers (and LLMs) love