Installation
The quickest way to install Detent on macOS is Homebrew. Everywhere else, build it from source with CMake.
Homebrew
Section titled “Homebrew”brew install Kronuz/tap/detentThat installs detent-authority, detent-agent and detent, plus the launchd service
templates under $(brew --prefix)/share/detent/. To track main instead of the
pinned revision, use brew install --HEAD Kronuz/tap/detent.
Requirements
Section titled “Requirements”- A C++20 compiler and standard library that provide
std::jthreadand stop tokens. Configuration checks this before building. libc++ 20 and newer, recent libstdc++, and Apple Clang 17 all work. - CMake 3.24 or newer.
- Git and network access on the first configure; every dependency is
fetched with CMake
FetchContent. - OpenSSL 3.0 or newer for the managed agent and the durable authority.
- For the integration tests only: Python 3, Bash, curl, and the
opensslcommand-line tool onPATH. The running daemons don’t need them.
Detent is developed and qualified on macOS, Linux and FreeBSD.
Building
Section titled “Building”git clone https://github.com/Kronuz/Detent.gitcd Detentcmake -B build -DCMAKE_BUILD_TYPE=Releasecmake --build build -jThat produces, under build/src/:
| Binary | What it is |
|---|---|
detent-authority | The durable authority daemon |
detent-agent | The host-local agent daemon |
detent | The shell reader: detent get NAME |
You also get the static libraries, examples in build/examples/, benchmarks in
build/benchmarks/, and the test suite.
Build Options
Section titled “Build Options”| Option | Default | Effect |
|---|---|---|
DETENT_BUILD_MANAGED_AGENT | ON | Build managed (authority) delivery support into detent-agent |
DETENT_BUILD_AUTHORITY | ON | Build detent-authority, the durable authority daemon, with its HTTP, reactor and consensus dependencies |
DETENT_BUILD_TESTS | ON | Build the test suite |
DETENT_BUILD_EXAMPLES | ON | Build detent_demo |
DETENT_BUILD_BENCHMARKS | ON | Build the benchmarks |
DETENT_BUILD_PYTHON | OFF | Build the Python binding, a C extension over libdetent_reader (needs Python 3 development headers) |
DETENT_BUILD_RUST | OFF | Build the Rust binding over libdetent_reader (needs cargo and rustc) |
A reader-only build, for an application that only links detent::reader to
read a managed agent’s generations, can skip the network stack entirely:
cmake -B build -DDETENT_BUILD_AUTHORITY=OFF -DDETENT_BUILD_MANAGED_AGENT=OFFTesting
Section titled “Testing”ctest --test-dir build --output-on-failureThe suite covers the core library (schema validation, golden hash vectors), the reader core and the scenario table its bindings share, the agent’s command line, and the authority, delivery and local-image libraries.
Installing
Section titled “Installing”cmake --install build --prefix /usr/localThis installs detent-authority, detent-agent and detent into bin/, and the
service templates for systemd, launchd and rc.d into share/detent/. See
System Services to run them under a service
manager.
Using Detent from Your Own CMake Project
Section titled “Using Detent from Your Own CMake Project”include(FetchContent)FetchContent_Declare(detent GIT_REPOSITORY https://github.com/Kronuz/Detent.git GIT_TAG main)FetchContent_MakeAvailable(detent)
target_link_libraries(my_app PRIVATE detent::detent)add_subdirectory() of a local checkout works the same way. See
Using Detent in a C++ Application for the
rest.