jdx/mise · error · eyre::Report

apt system packages are not supported for OCI architecture {

Error message

apt system packages are not supported for OCI architecture {other:?}

What it means

apt_architecture maps the target OCI architecture to a Debian architecture name for the apt/dpkg invocation. Only x86 (amd64/x86_64) and ARM64 (arm64/aarch64) have mappings; building an apt system-packages layer for any other platform (arm/v7, 386, riscv64, ppc64le, s390x) has no Debian arch to pass, so mise refuses before running apt.

Source

Thrown at src/oci/packages.rs:592

fn remove_dir_children(path: &Path) -> Result<()> {
    match fs::read_dir(path) {
        Ok(entries) => {
            for entry in entries {
                remove_path(&entry?.path())?;
            }
            Ok(())
        }
        Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()),
        Err(e) => Err(e).wrap_err_with(|| format!("reading directory {}", path.display())),
    }
}

fn apt_architecture(oci_arch: &str) -> Result<&'static str> {
    match oci_arch {
        "amd64" | "x86_64" => Ok("amd64"),
        "arm64" | "aarch64" => Ok("arm64"),
        other => bail!("apt system packages are not supported for OCI architecture {other:?}"),
    }
}

fn apk_architecture(oci_arch: &str) -> Result<&'static str> {
    match oci_arch {
        "amd64" | "x86_64" => Ok("x86_64"),
        "arm64" | "aarch64" => Ok("aarch64"),
        other => bail!("apk system packages are not supported for OCI architecture {other:?}"),
    }
}

fn snapshot(root: &Path) -> Result<BTreeMap<PathBuf, FsEntry>> {
    let mut out = BTreeMap::new();
    for entry in WalkDir::new(root).follow_links(false).sort_by_file_name() {
        let entry = entry?;
        let rel = entry.path().strip_prefix(root)?;
        if rel.as_os_str().is_empty() {
            continue;

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Restrict oci builds that carry apt entries to linux/amd64 or linux/arm64 platforms
  2. Drop the `[bootstrap.packages.apt]` table for other platforms and bake packages into the base image for those targets instead
  3. Split the build: base images with preinstalled packages for unsupported arches, apt bootstrap only for amd64/arm64

Example fix

# before — one config for all platforms
[bootstrap.packages.apt]
ripgrep = "any"

# after — per-platform mise.toml: keep the table only in the
# linux/amd64 and linux/arm64 variants, omit it elsewhere
Defensive patterns

Strategy: validation

Validate before calling

// Gate apt-backed oci builds on supported platforms before invoking mise.
fn platform_supports_apt_packages(oci_arch: &str) -> bool {
    matches!(oci_arch, "amd64" | "x86_64" | "arm64" | "aarch64")
}

if !platform_supports_apt_packages(&target_arch) {
    eprintln!("skipping [bootstrap.packages.apt]: {target_arch} unsupported");
}

Type guard

fn apt_arch_supported(oci_arch: &str) -> bool {
    matches!(oci_arch, "amd64" | "x86_64" | "arm64" | "aarch64")
}

Prevention

When it happens

Trigger: `mise oci build` targeting a platform other than linux/amd64 or linux/arm64 (e.g. `--platform linux/arm/v7` for a Raspberry Pi image) while `[bootstrap.packages.apt]` entries are present.

Common situations: Multi-arch build matrices that include 32-bit ARM or exotic ISAs; embedded targets where the team assumed full platform parity.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/9fb59fa4efa871d4. Report an issue: GitHub.