compi-0.5.2 is not a library.
Compi
A build system written in Rust.
Features
- Clean TOML structure: Simple and declarative task definitions.
- Incremental Builds: Tracks file hashes and modification times to skip unnecessary work.
- Dependencies: Automatic DAG resolution for complex build chains.
- Parallel Execution: Concurrent execution of independent tasks.
Installation
From crates.io
From GitHub
From Source
From GitHub Releases
Download the latest binary for your platform from the GitHub Releases page.
Linux
macOS
Windows
Download the executable from the releases page and add it to your PATH.
CLI Usage
| Flag | Description |
|---|---|
-f, --file <FILE> |
Configuration file (default: compi.toml) |
-j, --workers <N> |
Number of parallel workers (default: CPU cores) |
-t, --timeout <DURATION> |
Default timeout (e.g., "30s", "5m") |
--output <MODE> |
Output mode: group (default) or stream |
--dry-run |
Preview execution order without running tasks |
--rm |
Remove output files after successful execution |
-v, --verbose |
Enable verbose logging |
Configuration Reference
Create a compi.toml in your project root.
[]
= "build"
= ".compi_cache"
= 4
= "10m"
= "group"
[]
= "target"
= "src/**/*.rs"
= "--release"
[]
= "mkdir -p ${TARGET}"
= ["${TARGET}/"]
= ["p"]
[]
= ["prepare"]
= "cargo build ${FLAGS}"
= ["${SRC}", "Cargo.toml"]
= ["${TARGET}/app"]
= ["b"]
[]
= ["build"]
= "cargo test"
= ["tests/**/*.rs"]
= true
= ["t"]
[]
= "rm -rf ${TARGET}"
Reference
Task Fields
| Field | Type | Description |
|---|---|---|
command |
String | Required. Shell command to execute. |
dependencies |
[String] | List of task IDs that must complete first. |
inputs |
[String] | List of files/globs to track for changes. |
outputs |
[String] | List of files/globs this task produces. |
aliases |
[String] | Short names for CLI invocation (e.g. ["b"]). |
always_run |
Boolean | If true, ignore cache and always execute. |
auto_remove |
Boolean | If true, delete outputs after success (temp files). |
timeout |
String | Duration string (e.g. "30s") for this specific task. |
Caching & Execution Logic
Compi uses a local cache (compi_cache.json) to skip tasks that are up-to-date.
A task is SKIPPED if:
- All
outputsexist. - The
inputscontent hash matches the previous run. - The
inputsmodification times are older than theoutputs.
A task RUNS if:
- It has no
inputsdefined. always_runis set totrue.- Any output file is missing.
- Input files have changed (content hash mismatch).
- Input files are newer than output files.
Output Cleanup
--rmflag: Deletes files listed inoutputsafter the task succeeds.auto_remove = true: Acts like--rmis always passed for that specific task.