Skip to main content

BuildError

Enum BuildError 

Source
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

Fields

§package: String
§selector: String
§

UnknownTargetInPackage

Fields

§package: String
§target: String
§

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

§package: String
§candidates: Vec<String>

Qualified package:target spellings of the dependency package’s library and header-only targets.

§

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).

Fields

§package: String
§

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.

Fields

§target: String
§package: String
§missing: Vec<String>
§

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

§consumer: String
§dep_target: String
§dep_package: String
§missing: Vec<String>
§fix: FeatureGateFix

Where 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

§gated: Vec<(String, Vec<String>)>

(package:target, missing features) pairs, in selection order.

§

EmptyTargetSources(String)

§

InvalidSourcePath

Fields

§target: String
§reason: String
§

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.

Fields

§detail: String
§

UnrecognizedSourceExtension

A target carries a source whose extension does not match any of Cabin’s recognized C/C++ extensions.

Fields

§target: String
§

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.

Fields

§target: String
§

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.

Fields

§target: String
§language: &'static str
§field: &'static str
§

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

§consumer: String
§dependency: String
§language: &'static str
§consumer_standard: &'static str
§required: &'static str
§requirement_source: &'static str
§

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.

Fields

§target: String
§language: &'static str
§standard: &'static str
§

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.

Fields

§target: String
§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for BuildError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for BuildError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ToolDetectionError> for BuildError

Source§

fn from(source: ToolDetectionError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V