Build and test
Requirements
Use Rust 1.89 or newer, a C compiler and CMake. Windows requires MSVC. The TLS dependency aws-lc compiles native code.
cargo build --release --locked
The executable is target/release/cjr, or target/release/cjr.exe on Windows. Cargo.lock pins the dependency graph; commit it together with dependency changes.
Routine checks
cargo fmt --all -- --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --all-targets --locked
Tests cover binary parsing, CLI arguments, download failures, cache lifecycle and process state. HTTP scenarios use mockito; arbitrary-input tests use proptest. Ordinary tests use local fixtures and mock services.
CI runs these checks and release builds on Windows, Linux, macOS ARM64 and Intel. A separate Linux job checks the minimum Rust version. The website job builds the landing page and documentation.
Implementation rules
- Keep FFI and necessary unsafe operations inside the private
platformmodule, behind safe interfaces with documented preconditions. - Hold
StoreTransactionfor cache mutations and usage registration. Keep cjv-owned files intact. - Use backon for retries, walkdir for directory traversal and object for binary formats.
- Retain usage records when descendant liveness is uncertain. Preserve the application’s exit status even when cleanup fails.