pub async fn detect_backend(target_os: ImageOs) -> Result<Arc<dyn BuildBackend>>Expand description
Auto-detect the best available build backend for the given target OS.
Thin wrapper around detect_backend_with_options that passes
options = None. Use this from call sites that have no access to a
BuildOptions (early-construction probes, pipeline scaffolding) and
therefore can only consult ZLAYER_BACKEND + the auto-detect matrix.
Selection matrix (host × target), when no override is set:
| Host / Target | Linux image | Windows image | Darwin image |
|---|---|---|---|
| Linux | buildah-sidecar if available, else buildah-cli | Err — requires Windows host | Err — requires macOS host |
| macOS | VZ buildah sidecar / buildah-cli (no sandbox fallback) | Err — requires Windows host | Seatbelt sandbox backend |
| Windows | Err — Linux peer required (WSL2 follow-up) | HCS-backed native Windows builder (L-4) | Err — requires macOS host |
§Errors
Returns an error if the host cannot build images for the requested
target_os, or if the selected backend’s tooling is missing.