Skip to main content

cabin_core/
lib.rs

1//! Stable internal data model for Cabin.
2//!
3//! This crate defines the validated, format-agnostic types that the rest of
4//! the workspace builds on. Manifest parsing, the CLI, and (later) the build
5//! graph all consume the same `Package` value, so changes here ripple
6//! everywhere — keep this surface small.
7//!
8//! Crate boundaries:
9//! - this crate must not depend on `clap`, `toml`, or any raw manifest
10//!   Structs;
11//! - manifest-shaped serde structs live in `cabin-manifest`;
12//! - CLI dispatch lives in `cabin`.
13
14pub mod build_flags;
15pub mod build_jobs;
16pub mod compiler;
17pub mod compiler_wrapper;
18pub mod condition;
19pub mod config;
20pub mod config_source;
21pub mod error;
22pub mod hash;
23pub mod language_standard;
24pub mod model;
25pub mod patch;
26pub mod process;
27pub mod profile;
28pub mod registry;
29pub mod source_language;
30pub mod source_replacement;
31pub mod term_color;
32pub mod term_verbosity;
33pub mod toolchain;
34pub mod version_req;
35
36pub use build_flags::{
37    BuildFlagsValidationError, ConditionalProfileFlags, ProfileFlags, ProfileSettings,
38    ResolvedProfileFlags, resolve_build_flags,
39};
40pub use build_jobs::{BuildJobs, BuildJobsParseError};
41pub use compiler::{
42    ArchiverCapabilities, ArchiverIdentity, ArchiverKind, Capability, CapabilitySource,
43    CompilerCapabilities, CompilerIdentity, CompilerKind, CompilerVersion, ToolDetection,
44    ToolDetectionError, ToolchainDetectionReport, c_standard_capability, cxx_standard_capability,
45    derive_ar_capabilities, derive_cxx_capabilities, parse_ar_version_output,
46    parse_cxx_version_output, standard_support_detail, validate_ar_for_backend,
47    validate_c_standards, validate_cc_for_backend, validate_cxx_for_backend,
48    validate_cxx_standards,
49};
50pub use compiler_wrapper::{
51    CompilerWrapperIdentity, CompilerWrapperKind, CompilerWrapperManifestSettings,
52    CompilerWrapperParseError, CompilerWrapperRequest, CompilerWrapperSource,
53    CompilerWrapperSummary, ConditionalCompilerWrapperDecl, ResolvedCompilerWrapper,
54};
55pub use condition::{
56    CompilerSlot, Condition, ConditionContext, ConditionKey, ConditionParseError, TargetPlatform,
57};
58pub use config::{
59    BuildConfiguration, BuildConfigurationInput, DEFAULT_FEATURE_KEY, FeatureEntry, Features,
60    InvalidFeatureEntryKind, SelectionRequest, ToolchainSummary,
61};
62pub use config_source::ConfigValueSource;
63pub use error::ValidationError;
64pub use language_standard::{
65    CStandard, CxxStandard, DEFAULT_C_STANDARD, DEFAULT_CXX_STANDARD, InterfaceStandard,
66    InterfaceStandardSource, LanguageStandard, LanguageStandardParseError,
67    LanguageStandardSettings, LanguageStandardSource, LanguageStandardsSummary,
68    ResolvedLanguageStandards, ResolvedStandard, STANDARD_FLAG_PREFIXES, StandardDeclaration,
69    StandardFlagConflict, TargetStandardsSummary, WorkspaceStandardDefaults, effective_c,
70    effective_cxx, find_standard_flag_conflicts, imposes_requirement, interface_c, interface_cxx,
71    resolve_language_standards,
72};
73pub use model::{
74    Dependency, DependencyKind, DependencySource, Package, PackageConfigInput, PackageName,
75    PortDepSource, SystemDependency, Target, TargetKind, TargetName, WorkspaceDepRequirements,
76    is_path_safe_package_name,
77};
78pub use patch::{
79    DeclaredPatch, PatchManifestSettings, PatchProvenance, PatchSource, PatchSourceKind,
80    PatchValidationError,
81};
82pub use process::{ExitStatusKind, exit_status_kind};
83pub use profile::{
84    BuiltinProfile, InvalidProfileName, OptLevel, ProfileDefaults, ProfileDefinition, ProfileName,
85    ProfileResolutionError, ProfileSelection, ProfileSource, ResolvedProfile,
86    available_profile_names, resolve_profile,
87};
88pub use source_language::{SourceLanguage, classify_source, link_driver_language};
89pub use source_replacement::{
90    SourceLocator, SourceReplacementEntry, SourceReplacementError, SourceReplacementResolution,
91    SourceReplacementSettings,
92};
93pub use term_color::{ColorChoice, ColorEnvError, InvalidColorChoice};
94pub use term_verbosity::{InvalidVerbosityCombination, Verbosity, VerbosityEnvError};
95pub use toolchain::{
96    ConditionalToolchainDecl, ResolvedTool, ResolvedToolchain, ToolKind, ToolSelection, ToolSource,
97    ToolSpec, ToolchainDecl, ToolchainResolutionError, ToolchainSelection, ToolchainSettings,
98};