pub enum BuildError {
Show 37 variants
DockerfileParse {
message: String,
line: usize,
},
ContextRead {
path: PathBuf,
source: Error,
},
PathEscape {
path: PathBuf,
},
FileIgnored {
path: PathBuf,
},
StageNotFound {
name: String,
},
RunFailed {
command: String,
exit_code: i32,
},
LayerCreate {
message: String,
},
CacheError {
message: String,
},
RegistryError {
message: String,
},
BinfmtNotRegistered {
platform: String,
qemu_arch: String,
},
IoError(Error),
VariableExpansion(String),
InvalidInstruction {
instruction: String,
reason: String,
},
BuildahExecution {
command: String,
exit_code: i32,
stderr: String,
},
ContextTooLarge {
size: u64,
max: u64,
},
BaseImageNotFound {
image: String,
},
CircularDependency {
stages: Vec<String>,
},
BuildahNotFound {
message: String,
},
ZImagefileParse {
message: String,
},
ZImagefileValidation {
message: String,
},
PipelineError {
message: String,
},
WasmBuild(WasmBuildError),
NotSupported {
operation: String,
},
NotYetImplemented(String),
SandboxNeedsLinux {
command: String,
reason: String,
},
RunStepFailed {
step_index: usize,
exit_code: i32,
stderr_tail: String,
},
LayerExportFailed {
source: Error,
},
ChocoResolutionFailed {
package: String,
source_distro: String,
},
PathTraversal {
src: String,
},
HttpFetchFailed {
url: String,
source: Error,
},
TarExtractFailed {
source: Error,
},
OsVersionUnresolved,
LayerDigestComputationFailed {
source: Error,
},
SerializeManifestFailed {
source: Error,
},
PushFailed {
tag: String,
reason: String,
},
BlobUploadFailed {
digest: String,
tag: String,
reason: String,
},
ManifestPutFailed {
tag: String,
reason: String,
},
}Expand description
Build-specific errors
Variants§
DockerfileParse
Dockerfile parsing failed
Fields
ContextRead
Failed to read build context
PathEscape
Path escape attempt detected (security violation)
FileIgnored
File was ignored by .dockerignore
StageNotFound
Referenced stage not found
RunFailed
RUN instruction failed
LayerCreate
Failed to create layer
CacheError
Cache operation failed
RegistryError
Registry operation failed
BinfmtNotRegistered
A cross-architecture build was requested but the host has no
binfmt_misc / qemu-user-static handler registered for the target
architecture, so buildah cannot execute foreign-arch RUN steps.
Fields
IoError(Error)
IO error
VariableExpansion(String)
Variable expansion failed
InvalidInstruction
Invalid instruction
BuildahExecution
Buildah command execution failed
Fields
ContextTooLarge
Build context too large
BaseImageNotFound
Base image not found
CircularDependency
Circular dependency in multi-stage build
BuildahNotFound
Buildah binary not found or installation failed
ZImagefileParse
ZImagefile YAML deserialization failed
ZImagefileValidation
ZImagefile semantic validation failed
PipelineError
Pipeline validation or execution error
WasmBuild(WasmBuildError)
WASM build failed
NotSupported
Operation not supported by this backend
NotYetImplemented(String)
A code path that is reserved for a future phase / task and is
intentionally not yet wired up. Constructed by
BuildError::not_yet_implemented so call sites can give a precise
reason (typically referencing the follow-up task that delivers it,
e.g. “RUN execution lands in Phase 4 task 4.B”).
This is distinct from BuildError::NotSupported, which signals a
permanent capability gap of the chosen backend; NotYetImplemented
signals “tracked work, coming in a later task — do not silently
no-op”.
SandboxNeedsLinux
A macOS sandbox build step cannot be performed natively because it genuinely needs a Linux environment — a Linux toolchain / libc / kernel headers, a Linux-only package with no Homebrew bottle, or a Linux ELF binary that cannot execute on Darwin.
Distinct from BuildError::RunFailed (a command that actually ran
and exited non-zero — i.e. a user error) and from
BuildError::NotSupported (a permanent backend capability gap):
SandboxNeedsLinux signals “this is faithfully buildable, just not
here — retry on the buildd-in-VZ Linux path”. The build front-end keys
its sandbox -> VZ-Linux fallback off this variant, so it must NOT be
raised for a broken command and must NOT be swallowed as a silent
success.
Fields
RunStepFailed
A specific RUN step in a Dockerfile failed with a non-zero exit code. Carries the step index (0-based, counted across the active stage’s instruction list), the exit code surfaced by the guest process, and a stderr tail to anchor diagnostics.
Distinct from BuildError::RunFailed in that the latter is
emitted by the buildah/HCS backends working through the
BuildBackend trait, whereas this variant is emitted by the
Phase 4 WindowsBuilder path which carries a richer per-step
context (the step index and a stderr tail) than the buildah
path can produce.
Fields
LayerExportFailed
HcsExportLayer / wclayer-side IO failed while capturing the
post-RUN scratch diff. Distinct from BuildError::IoError so
the WCOW builder can surface a layer-export-specific message
(the underlying failure is almost always either an
HcsExportLayer HRESULT or a tar/gzip walk error).
ChocoResolutionFailed
Chocolatey resolver could not produce a Windows equivalent for a
Linux package name encountered in a RUN instruction. The package
is named so the user can edit the Dockerfile (or contribute the
mapping to RepoSources).
Fields
PathTraversal
COPY/ADD source path contained a .. component which is forbidden
because it would escape the build context. Surfaced before any
filesystem access so a malicious Dockerfile cannot reach files
outside the build directory even via a TOCTOU window.
HttpFetchFailed
ADD <URL> <dest> failed to download the remote resource. Carries
the URL for diagnostics; the underlying network/protocol failure is
chained as the source so users get the precise cause (connection
refused, 404, TLS error, etc.).
TarExtractFailed
ADD auto-extraction of a tarball failed. Carries the chained IO
error from the tar / flate2 / bzip2 / xz2 pipeline so the
user can see which entry tripped (path traversal in the archive,
disk full, etc.).
OsVersionUnresolved
The WCOW builder could not resolve an os.version for the emitted
OCI image config. The Windows runtime refuses to launch a
container whose os.version does not exactly match the host
kernel’s build, so emitting a manifest without one would produce
an image nothing can run. Surfaces when the base manifest’s
os.version is missing AND the user did not pass
WindowsBuildConfig::os_version_override.
LayerDigestComputationFailed
Computing a sha256 digest over a layer blob (or an in-memory manifest blob) failed because the underlying IO read failed. Carries the chained IO error so callers can see which file tripped.
SerializeManifestFailed
JSON serialisation of the emitted OCI image config or manifest
blob failed. In practice this only happens if a value carried on
the crate::windows_builder::OciImageConfig is itself
unserialisable, which is a programmer error in this crate.
PushFailed
Top-level wrapper for any failure during the WCOW
crate::windows_builder::WindowsBuilder::push flow. Returned when
the push could not be completed but the failure is not better
described by BuildError::BlobUploadFailed or
BuildError::ManifestPutFailed — for example, when reading a
local layer blob off disk fails before it ever reaches the wire.
Fields
BlobUploadFailed
A single layer blob upload PUT/PATCH chain failed. Carries the blob’s content-addressable digest so the operator can correlate against registry-side logs.
Fields
ManifestPutFailed
The final PUT /v2/<name>/manifests/<tag> request failed.
Distinct from BuildError::BlobUploadFailed because the manifest
PUT is the last write that makes the push observable from the
registry — a failure here means the layers and config blob may be
staged but the image is not yet visible under tag.
Implementations§
Source§impl BuildError
impl BuildError
Sourcepub fn parse_error(msg: impl Into<String>, line: usize) -> Self
pub fn parse_error(msg: impl Into<String>, line: usize) -> Self
Create a DockerfileParse error from a message and line number
Sourcepub fn context_read(path: impl Into<PathBuf>, source: Error) -> Self
pub fn context_read(path: impl Into<PathBuf>, source: Error) -> Self
Create a ContextRead error from a path and IO error
Sourcepub fn path_escape(path: impl Into<PathBuf>) -> Self
pub fn path_escape(path: impl Into<PathBuf>) -> Self
Create a PathEscape error
Sourcepub fn stage_not_found(name: impl Into<String>) -> Self
pub fn stage_not_found(name: impl Into<String>) -> Self
Create a StageNotFound error
Sourcepub fn run_failed(command: impl Into<String>, exit_code: i32) -> Self
pub fn run_failed(command: impl Into<String>, exit_code: i32) -> Self
Create a RunFailed error
Sourcepub fn layer_create(msg: impl Into<String>) -> Self
pub fn layer_create(msg: impl Into<String>) -> Self
Create a LayerCreate error
Sourcepub fn cache_error(msg: impl Into<String>) -> Self
pub fn cache_error(msg: impl Into<String>) -> Self
Create a CacheError
Sourcepub fn registry_error(msg: impl Into<String>) -> Self
pub fn registry_error(msg: impl Into<String>) -> Self
Create a RegistryError
Sourcepub fn invalid_instruction(
instruction: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_instruction( instruction: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an InvalidInstruction error
Sourcepub fn buildah_execution(
command: impl Into<String>,
exit_code: i32,
stderr: impl Into<String>,
) -> Self
pub fn buildah_execution( command: impl Into<String>, exit_code: i32, stderr: impl Into<String>, ) -> Self
Create a BuildahExecution error
Sourcepub fn buildah_not_found(message: impl Into<String>) -> Self
pub fn buildah_not_found(message: impl Into<String>) -> Self
Create a BuildahNotFound error
Sourcepub fn zimagefile_parse(message: impl Into<String>) -> Self
pub fn zimagefile_parse(message: impl Into<String>) -> Self
Create a ZImagefileParse error
Sourcepub fn zimagefile_validation(message: impl Into<String>) -> Self
pub fn zimagefile_validation(message: impl Into<String>) -> Self
Create a ZImagefileValidation error
Sourcepub fn pipeline_error(message: impl Into<String>) -> Self
pub fn pipeline_error(message: impl Into<String>) -> Self
Create a PipelineError
Sourcepub fn not_yet_implemented(msg: impl Into<String>) -> Self
pub fn not_yet_implemented(msg: impl Into<String>) -> Self
Create a NotYetImplemented error. The msg should name the
follow-up task or phase that delivers the missing behavior
(e.g. "RUN execution lands in Phase 4 task 4.B").
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()
Source§impl From<Error> for BuildError
impl From<Error> for BuildError
Source§impl From<ToolchainError> for BuildError
Convert a zlayer-toolchain error into a BuildError.
impl From<ToolchainError> for BuildError
Convert a zlayer-toolchain error into a BuildError.
The toolchain crate (the macOS keg provisioner — source build + prebuilt
fetch) is a leaf crate, extracted from this crate to break the
builder<->agent build cycle. Its errors flow back through ? at the builder
call sites (e.g. ensure_toolchain(..).await? when materializing a keg into
a build rootfs), so they need a From bridge. The IoError arm is
preserved structurally; everything else folds into RegistryError carrying
the rendered message.
Source§fn from(err: ToolchainError) -> Self
fn from(err: ToolchainError) -> Self
Source§impl From<WasmBuildError> for BuildError
impl From<WasmBuildError> for BuildError
Source§fn from(source: WasmBuildError) -> Self
fn from(source: WasmBuildError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for BuildError
impl !UnwindSafe for BuildError
impl Freeze for BuildError
impl Send for BuildError
impl Sync for BuildError
impl Unpin for BuildError
impl UnsafeUnpin for BuildError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.