Expand description
Typed compiler / tool identity and capability model.
Cabin’s build planner emits GCC/Clang-style commands. The
ResolvedToolchain (see crate::toolchain) says which
tools the user picked; this module says what those tools are
and what they can do. The
resolver in cabin-toolchain::detect runs harmless --version
invocations against each resolved tool, hands the output to the
pure parsers in this module, and assembles a typed
ToolchainDetectionReport.
This module is data and pure logic only. Process spawning, filesystem traversal, and CLI dispatch live elsewhere.
Structs§
- Archiver
Capabilities - Capability set for a static-library archiver.
- Archiver
Identity - Detected identity of a static-library archiver.
- Capability
- One typed capability decision: whether the tool supports it, and where the answer came from.
- Compiler
Capabilities - Capability set for a C/C++ compiler. Every field is decided during detection so the planner can compare its required set against the resolved set without re-running parsing logic.
- Compiler
Identity - Detected identity of one C/C++ compiler.
- Compiler
Version - Decomposed compiler / archiver version (
major.minor.patch). - Tool
Detection - One tool’s detection outcome plus the path it was invoked at.
pathis the resolved absolute path fromcrate::ResolvedToolchain; it is preserved here so error messages can mention the exact executable. - Toolchain
Detection Report - Whole-toolchain detection report. The CLI builds one per invocation that needs detection (build / metadata) and threads it into the planner and the metadata view.
Enums§
- Archiver
Kind - Recognized static-library archiver family.
- Capability
Source - Where one capability decision came from. Recorded so
cabin metadatacan show whether Cabin trusted the version alone, ran a probe, or fell back to a conservative default. - Compiler
Kind - Recognized C/C++ compiler family.
- Tool
Detection Error - Errors produced while validating a detection report against the current C++ backend’s required capability set.
Functions§
- derive_
ar_ capabilities - Derive an
ArchiverCapabilitiesset from the detected identity. - derive_
cxx_ capabilities - Derive a
CompilerCapabilitiesset from the detected identity. Decisions are made from the recognized compiler kind, with conservative defaults forCompilerKind::Unknown. No probe commands are run from this function — the caller’s detection layer already gathered everything we need. - parse_
ar_ version_ output - Pure parser for archiver
--versionoutput. The recognized families (arandllvm-ar) print one line that includes the family name. Anything else is classified asArchiverKind::Unknown; archivers that exit non-zero on--versionare left to the subprocess layer to surface asUnknown. - parse_
cxx_ version_ output - Pure parser for compiler
--versionoutput. - validate_
ar_ for_ backend - Validate that the resolved archiver can handle the planner’s
ar crs <lib> <objs>invocation. - validate_
cc_ for_ backend - Validate that the resolved C compiler supports the C-side
command shape the planner emits: GCC-style flags plus
-MMD -MFdepfile generation. Unlikevalidate_cxx_for_backend, this validator does not require-std=c++17support — a pure-C driver that lacks C++ mode is acceptable when the target only carries C translation units. - validate_
cxx_ for_ backend - The capability set the current C++ backend requires.