pub enum BuildError {
Show 23 variants
DependencyCycle(Vec<String>),
UnknownTargetReference(String),
AmbiguousTarget(String, Vec<String>),
UnknownPackageInTargetSelector {
package: String,
selector: String,
},
UnknownTargetInPackage {
package: String,
target: String,
},
NoSameNameTargetInDependency {
dep: String,
package: String,
candidates: Vec<String>,
},
DevDependencyNotActive {
dep: String,
package: String,
},
TargetRequiresFeatures {
target: String,
package: String,
missing: Vec<String>,
},
TargetDepRequiresFeatures {
consumer: String,
dep_target: String,
dep_package: String,
missing: Vec<String>,
fix: FeatureGateFix,
},
AllDefaultTargetsRequireFeatures {
gated: Vec<(String, Vec<String>)>,
},
EmptyTargetSources(String),
InvalidSourcePath {
target: String,
path: Utf8PathBuf,
reason: String,
},
NonUtf8Path(PathBuf),
EmptySelectedPackages,
UnsupportedToolchain(ToolDetectionError),
MixedToolchainDialects {
detail: String,
},
UnrecognizedSourceExtension {
target: String,
path: Utf8PathBuf,
},
MissingCCompiler {
target: String,
path: Utf8PathBuf,
},
MissingLanguageStandard {
target: String,
language: &'static str,
field: &'static str,
},
IncompatibleLanguageStandard {
consumer: String,
dependency: String,
language: &'static str,
consumer_standard: &'static str,
required: &'static str,
requirement_source: &'static str,
},
StandardUnsupportedOnMsvcDialect {
target: String,
language: &'static str,
standard: &'static str,
},
GnuExtensionsUnsupportedOnMsvcDialect {
target: String,
},
StandardFlagConflict(Box<StandardFlagConflict>),
}Expand description
Errors produced while planning a build graph.
Variants§
DependencyCycle(Vec<String>)
UnknownTargetReference(String)
AmbiguousTarget(String, Vec<String>)
UnknownPackageInTargetSelector
UnknownTargetInPackage
NoSameNameTargetInDependency
A target’s deps entry names a package dependency by its
bare name, but the dependency declares no library or
header-only target with that name. A bare name is shorthand
for a same-named linkable target (foo means foo:foo);
packages never export a default target, so anything else -
including a same-named executable - must be spelled
package:target.
Fields
DevDependencyNotActive
A target’s deps entry names a package that the owning
manifest only declares under [dev-dependencies], but no
active dev edge backs it: either the referencing target is
not a dev-only kind (test / example), or the invocation
did not activate dev-deps for the owning package (cabin test activates them for the selected packages only).
TargetRequiresFeatures
An explicitly selected target’s required-features are not
all enabled. Default enumeration silently skips such
targets; naming one (cabin test --test, cabin run --bin, a manifest-target selector) is a hard error.
TargetDepRequiresFeatures
A deps entry resolves to a target whose
required-features are not all enabled on the providing
package. The attached FeatureGateFix names the place
that can actually enable them.
Fields
fix: FeatureGateFixWhere the missing features can be enabled.
AllDefaultTargetsRequireFeatures
Every default-buildable target in the selection was skipped
because its required-features are not enabled. Plain
BuildError::EmptySelectedPackages would hide the fix, so
the gated targets and their missing features are spelled
out.
Fields
EmptyTargetSources(String)
InvalidSourcePath
NonUtf8Path(PathBuf)
EmptySelectedPackages
UnsupportedToolchain(ToolDetectionError)
The detected toolchain cannot run the commands the C++ backend emits. The wrapped error carries the specific missing capability or unsupported compiler family.
MixedToolchainDialects
The selected tools individually run, but belong to
different command-line dialects (MSVC cl.exe / lib.exe
vs. GCC/Clang). Cabin emits one dialect per build, so a
mixed toolchain cannot be driven coherently.
UnrecognizedSourceExtension
A target carries a source whose extension does not match any of Cabin’s recognized C/C++ extensions.
MissingCCompiler
A target carries .c source(s) but no C compiler is
available. Set CC, pass --cc, or add cc = ... to
[toolchain] so Cabin can compile C translation units.
MissingLanguageStandard
A planned compile has no effective language standard: the
target compiles sources of a language neither its
[target.<name>] table nor its [package] declares a
standard for. Manifest loading rejects this before planning,
so this fires only for packages constructed outside the
manifest parser.
IncompatibleLanguageStandard
A consuming target’s effective implementation standard is
below a reachable library-like dependency’s interface
requirement for the same language. The planner records the
incompatibility on the consumer’s compile;
validate_planned_standards surfaces the first survivor
after the cabin check rewrite has pruned dependency
compiles.
Fields
StandardUnsupportedOnMsvcDialect
A compile that survived into the final build graph requests a
standard cl.exe has no stable /std: flag for. The planner
records such compiles as violations (it cannot lower them);
validate_planned_standards surfaces the first survivor after
the cabin check rewrite has pruned dependency compiles.
GnuExtensionsUnsupportedOnMsvcDialect
A compile that survived into the final build graph belongs to
a target that enables gnu-extensions on the MSVC dialect.
cl.exe has no GNU dialect mode, so the flag cannot be
honored and is never silently ignored.
StandardFlagConflict(Box<StandardFlagConflict>)
A planned compile carries both a first-class standard
declaration and an explicit -std= / /std: token in its
manifest-derived flag list. Boxed to keep the enum small;
#[source] keeps the typed conflict reachable on the error
chain so the diagnostic registry can attach its stable code.
Trait Implementations§
Source§impl Debug for BuildError
impl Debug for BuildError
Source§impl Display for BuildError
impl Display for BuildError
Source§impl Error for BuildError
impl Error for BuildError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()