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 experimental;
23pub mod hash;
24pub mod index_standards;
25pub mod language_standard;
26pub mod model;
27pub mod patch;
28pub mod process;
29pub mod profile;
30pub mod registry;
31pub mod source_language;
32pub mod source_replacement;
33pub mod standard_compatibility;
34pub mod term_color;
35pub mod term_verbosity;
36pub mod toolchain;
37pub mod version_req;
38
39pub use build_flags::{
40    BuildFlagsValidationError, ConditionalProfileFlags, ProfileFlags, ProfileSettings,
41    ResolvedProfileFlags, resolve_build_flags,
42};
43pub use build_jobs::{BuildJobs, BuildJobsParseError};
44pub use compiler::{
45    ArchiverCapabilities, ArchiverIdentity, ArchiverKind, Capability, CapabilitySource,
46    CompilerCapabilities, CompilerIdentity, CompilerKind, CompilerVersion, ToolDetection,
47    ToolDetectionError, ToolchainDetectionReport, c_standard_capability, cxx_standard_capability,
48    derive_ar_capabilities, derive_cxx_capabilities, parse_ar_version_output,
49    parse_cxx_version_output, standard_support_detail, validate_ar_for_backend,
50    validate_c_standards, validate_cc_for_backend, validate_cxx_for_backend,
51    validate_cxx_standards,
52};
53pub use compiler_wrapper::{
54    CompilerWrapperIdentity, CompilerWrapperKind, CompilerWrapperParseError,
55    CompilerWrapperRequest, CompilerWrapperSource, CompilerWrapperSummary, ResolvedCompilerWrapper,
56};
57pub use condition::{
58    CompilerSlot, Condition, ConditionContext, ConditionKey, ConditionParseError, TargetPlatform,
59};
60pub use config::{
61    BuildConfiguration, BuildConfigurationInput, DEFAULT_FEATURE_KEY, FeatureEntry, Features,
62    InvalidFeatureEntryKind, SelectionRequest, ToolchainSummary,
63};
64pub use config_source::ConfigValueSource;
65pub use error::ValidationError;
66pub use experimental::{ExperimentalFeature, UnknownExperimentalFeature};
67pub use index_standards::{StandardsMetadata, TargetStandards};
68pub use language_standard::{
69    CStandard, CxxStandard, InterfaceRequirement, InterfaceStandard,
70    InterfaceStandardContradiction, InterfaceStandardSource, LanguageStandard,
71    LanguageStandardParseError, LanguageStandardSettings, LanguageStandardSource,
72    LanguageStandardsSummary, ResolvedLanguageStandards, ResolvedStandard, STANDARD_FLAG_PREFIXES,
73    StandardDeclaration, StandardFlagConflict, StandardRequirement, TargetStandardsSummary,
74    WorkspaceStandardDefaults, effective_c, effective_cxx, effective_gnu_extensions,
75    find_interface_standard_contradictions, find_standard_flag_conflicts, imposes_requirement,
76    interface_c, interface_cxx, parse_interface_c, parse_interface_cxx, resolve_language_standards,
77};
78pub use model::{
79    Dependency, DependencyKind, DependencySource, Package, PackageConfigInput, PackageName,
80    PortDepSource, SystemDependency, Target, TargetDep, TargetKind, TargetName,
81    WorkspaceDepRequirements, is_path_safe_package_name,
82};
83pub use patch::{
84    DeclaredPatch, PatchManifestSettings, PatchProvenance, PatchSource, PatchSourceKind,
85    PatchValidationError,
86};
87pub use process::{ExitStatusKind, exit_status_kind};
88pub use profile::{
89    BuiltinProfile, InvalidProfileName, OptLevel, ProfileDefaults, ProfileDefinition, ProfileName,
90    ProfileResolutionError, ProfileSelection, ProfileSource, ResolvedProfile,
91    available_profile_names, resolve_profile,
92};
93pub use source_language::{SourceLanguage, classify_source, link_driver_language};
94pub use source_replacement::{
95    SourceLocator, SourceReplacementEntry, SourceReplacementError, SourceReplacementResolution,
96    SourceReplacementSettings,
97};
98pub use standard_compatibility::{
99    IncompatibleStandards, Requirement, UnknownIncompatibleStandards,
100};
101pub use term_color::{ColorChoice, ColorEnvError, InvalidColorChoice};
102pub use term_verbosity::{InvalidVerbosityCombination, Verbosity, VerbosityEnvError};
103pub use toolchain::{
104    ConditionalToolchainDecl, ResolvedTool, ResolvedToolchain, ToolKind, ToolSelection, ToolSource,
105    ToolSpec, ToolchainDecl, ToolchainResolutionError, ToolchainSelection, ToolchainSettings,
106};