Cabin Docs
Cabin is a Cargo-inspired package manager and build system for C
and C++. It treats C and C++ as first-class siblings: a single
project can mix .c and .cc translation units, the C and C++
standards stay separate, CC and CXX are kept independent, and
the resolved build configuration gets a deterministic fingerprint.
Cabin is Cargo-inspired, not Cargo-compatible: it borrows Cargo's vocabulary where the semantics line up and deliberately diverges where C/C++ semantics demand it. See Cargo-inspired interface for the full audit.
Where to start
If you are new to Cabin, the following pages cover the most common surfaces:
cabin newandcabin init— scaffold a new binary or library package.cabin.tomlreference — the manifest schema.- Configuration files —
.cabin/config.tomlprecedence and discovery. - Targets — how
cpp_library,cpp_executable,cpp_test, and friends are declared. - Dependency kinds — the two dependency kinds and how they activate.
- Build profiles —
dev,release, and user- declared profiles. - Environment variables — the
CABIN_*read, run, and test env surface.
Reference by topic
Manifest and configuration
cabin.tomlreference- Configuration files
- Environment variables
- Build profiles
- Toolchains and conditional build flags
Targets and building
Dependencies
- Dependency kinds
- Target / platform-specific dependencies
- Features
cabin.lockreference- Patch, override, and source replacement
- Vendoring and offline mode
- Source artifacts
Workspaces and observability
Distribution and registry interface
Quickstart
# 1. Create a fresh single-package project.
cabin new hello
cd hello
# 2. Build it.
cabin build
# 3. Run it. Forward args after `--`.
cabin run -- world
# 4. Inspect the resolved state.
cabin metadata
cabin tree
cabin explain package hello
A minimal cabin.toml:
[package]
name = "hello"
version = "0.1.0"
[target.hello]
type = "cpp_executable"
sources = ["src/main.cc"]
A two-package workspace:
# cabin.toml at the workspace root
[workspace]
members = ["app", "lib"]
# app/cabin.toml
[package]
name = "app"
version = "0.1.0"
[dependencies]
lib = { path = "../lib" }
[target.app]
type = "cpp_executable"
sources = ["src/main.cc"]
# lib/cabin.toml
[package]
name = "lib"
version = "0.1.0"
[target.lib]
type = "cpp_library"
sources = ["src/lib.cc"]