Expand description
Build profiles.
A profile is a named preset of build settings that affect how Cabin compiles a package — debug information, optimization level, assertions. Two profiles are built in:
dev— local development. Debug info on, no optimization, assertions on.release— optimized builds. Debug info off, full optimization, assertions off.
Manifests may declare additional [profile.<name>] tables to
override the built-in defaults or to add custom presets that
inherit from one of the built-ins. Resolution merges
parents-first and is fully typed; the rest of Cabin
(cabin-build, cabin, cabin-package) consumes a
ResolvedProfile directly and never sees raw TOML.
This module owns the model and the resolver. Manifest parsing
lives in cabin-manifest; CLI flag handling lives in
cabin.
Structs§
- Invalid
Profile Name cabin.toml’s public grammar limits which characters profile names may contain. The constructor surfaces this error type so callers (CLI, manifest parser) can format a clear diagnostic without duplicating the rule.- Profile
Defaults - Concrete defaults for one profile. Used to seed inheritance before any manifest overrides apply.
- Profile
Definition - One
[profile.<name>]declaration as it appeared incabin.toml, after manifest-level validation but before inheritance resolution. Every field exceptnameisOptionso the resolver can tell “user did not set this” from “user set this to a value”. - Profile
Name - Validated profile name.
- Profile
Selection - User-facing profile selection (one CLI invocation picks at
most one profile). The resolver expands this into a full
ResolvedProfileagainst a definition table. - Resolved
Profile - Fully resolved profile.
Enums§
- Builtin
Profile - One of the two profiles Cabin always provides without any manifest declaration.
- OptLevel
- Semantic optimization level. Mirrors the GCC / Clang
-Ofamily without exposing raw flag strings at the manifest layer; each value maps to a fixed GCC / Clang-style-Oflag (seeOptLevel::as_flag) that the build planner appends verbatim. There is no per-toolchain flag translation today. - Profile
Resolution Error - Errors produced by
resolve_profile. - Profile
Source - Where a
ResolvedProfileoriginated.
Functions§
- available_
profile_ names - Enumerate every profile name reachable for a given definition
set: the two built-ins plus every manifest-declared name.
Useful for
cabin metadata --profile-list-style consumers without forcing each caller to special-case built-ins. - resolve_
profile - Resolve a
ProfileSelectionagainst a set of manifestProfileDefinitions.