Skip to main content

Crate cabin_build

Crate cabin_build 

Source
Expand description

Backend-independent build planning for Cabin.

This crate consumes a validated cabin_core::Package plus a resolved C/C++ toolchain (from cabin-toolchain) and produces a BuildGraph - a list of compile, archive, and link actions plus the metadata needed to write a Clang-style compilation database.

The graph is intentionally backend-agnostic. cabin-ninja knows how to serialize it as build.ninja + compile_commands.json; future backends (e.g. a Bazel exporter, or a direct in-process executor) could consume the same structure.

Re-exports§

pub use check::into_check_graph;
pub use error::BuildError;
pub use error::FeatureGateFix;
pub use graph::BuildGraph;
pub use graph::CompileCommand;
pub use graph::StandardViolation;
pub use planner::ManifestTargetSelector;
pub use planner::PlanRequest;
pub use planner::plan;
pub use planner::select_targets_of_kind;
pub use planner::selector_required_features_met;
pub use standard_compat::DeclScope;
pub use standard_compat::DeclSite;
pub use standard_compat::EdgeRequirement;
pub use standard_compat::RequirementOrigin;
pub use standard_compat::StandardCompatViolation;
pub use validate::RequestedStandards;
pub use validate::collect_requested_standards;
pub use validate::msvc_external_includes_supported;
pub use validate::requested_standards_of;
pub use validate::validate_planned_standards;
pub use validate::validate_toolchain_for_backend;
pub use validate::validate_toolchain_standards;

Modules§

check
Transform a normal build graph into a syntax-check graph for cabin check. Each workspace compile becomes an -fsyntax-only check that produces a stamp instead of an object; archive, link, and dependency-package compiles are dropped. Pure and backend-independent: the transform flips each compile’s CompileMode to CompileMode::SyntaxOnly semantically, and the dialect lowering (cabin-ninja via cabin_driver::lower()) renders it through the c_check / cxx_check rules.
clean
Plan and execute the deletion list for cabin clean.
error
graph
link_diagnostics
Post-link-failure diagnostics.
planner
standard_compat
Post-resolution language-standard compatibility checking.
validate
Validate that a detected toolchain can run the commands the C++ backend emits.

Structs§

ArchiveAction
Archive object files into a static library.
CompileAction
Compile one translation unit.
CompileArguments
Semantic arguments for a compile, with no flag spelled out.
LinkAction
Link objects and static archives into an executable.

Enums§

BuildAction
A single semantic build step: compile a translation unit, archive objects into a static library, or link an executable.
CompileMode
What a compile action should produce.
Dialect
A compiler command-line family. Selected from the detected C++ compiler and threaded through planning and Ninja generation so every artifact name and command line speaks one dialect.