{"record":{"id":"9fb59fa4efa871d4","repo":"jdx/mise","slug":"apt-system-packages-are-not-supported-for-oci-arch","errorCode":null,"errorMessage":"apt system packages are not supported for OCI architecture {other:?}","messagePattern":"apt system packages are not supported for OCI architecture (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":592,"sourceCode":"\nfn remove_dir_children(path: &Path) -> Result<()> {\n    match fs::read_dir(path) {\n        Ok(entries) => {\n            for entry in entries {\n                remove_path(&entry?.path())?;\n            }\n            Ok(())\n        }\n        Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()),\n        Err(e) => Err(e).wrap_err_with(|| format!(\"reading directory {}\", path.display())),\n    }\n}\n\nfn apt_architecture(oci_arch: &str) -> Result<&'static str> {\n    match oci_arch {\n        \"amd64\" | \"x86_64\" => Ok(\"amd64\"),\n        \"arm64\" | \"aarch64\" => Ok(\"arm64\"),\n        other => bail!(\"apt system packages are not supported for OCI architecture {other:?}\"),\n    }\n}\n\nfn apk_architecture(oci_arch: &str) -> Result<&'static str> {\n    match oci_arch {\n        \"amd64\" | \"x86_64\" => Ok(\"x86_64\"),\n        \"arm64\" | \"aarch64\" => Ok(\"aarch64\"),\n        other => bail!(\"apk system packages are not supported for OCI architecture {other:?}\"),\n    }\n}\n\nfn snapshot(root: &Path) -> Result<BTreeMap<PathBuf, FsEntry>> {\n    let mut out = BTreeMap::new();\n    for entry in WalkDir::new(root).follow_links(false).sort_by_file_name() {\n        let entry = entry?;\n        let rel = entry.path().strip_prefix(root)?;\n        if rel.as_os_str().is_empty() {\n            continue;","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/oci/packages.rs#L574-L610","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Multi-arch build matrices that include 32-bit ARM or exotic ISAs; embedded targets where the team assumed full platform parity.","solutions":["Restrict oci builds that carry apt entries to linux/amd64 or linux/arm64 platforms","Drop the `[bootstrap.packages.apt]` table for other platforms and bake packages into the base image for those targets instead","Split the build: base images with preinstalled packages for unsupported arches, apt bootstrap only for amd64/arm64"],"exampleFix":"# before — one config for all platforms\n[bootstrap.packages.apt]\nripgrep = \"any\"\n\n# after — per-platform mise.toml: keep the table only in the\n# linux/amd64 and linux/arm64 variants, omit it elsewhere","handlingStrategy":"validation","validationCode":"// Gate apt-backed oci builds on supported platforms before invoking mise.\nfn platform_supports_apt_packages(oci_arch: &str) -> bool {\n    matches!(oci_arch, \"amd64\" | \"x86_64\" | \"arm64\" | \"aarch64\")\n}\n\nif !platform_supports_apt_packages(&target_arch) {\n    eprintln!(\"skipping [bootstrap.packages.apt]: {target_arch} unsupported\");\n}","typeGuard":"fn apt_arch_supported(oci_arch: &str) -> bool {\n    matches!(oci_arch, \"amd64\" | \"x86_64\" | \"arm64\" | \"aarch64\")\n}","tryCatchPattern":null,"preventionTips":["Keep per-platform mise.tomls: system-package tables only in the amd64/arm64 variants","For exotic platforms, preinstall packages in the base image instead of using [bootstrap.packages]"],"tags":["mise","oci","apt","architecture","cross-compile","platform"],"backgroundTag":"unsupported-architecture","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}