{"record":{"id":"1acc66ed99f14431","repo":"jdx/mise","slug":"apk-system-packages-are-not-supported-for-oci-arch","errorCode":null,"errorMessage":"apk system packages are not supported for OCI architecture {other:?}","messagePattern":"apk system packages are not supported for OCI architecture (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":600,"sourceCode":"        }\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;\n        }\n        out.insert(rel.to_path_buf(), fs_entry(entry.path())?);\n    }\n    Ok(out)\n}\n\nfn fs_entry(path: &Path) -> Result<FsEntry> {\n    let md = fs::symlink_metadata(path)?;","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/oci/packages.rs#L582-L618","documentation":"apk_architecture maps the target OCI architecture to an Alpine architecture name for the apk invocation. Only x86_64 (amd64/x86_64) and aarch64 (arm64/aarch64) are mapped; any other target platform (armv7, x86, riscv64, ppc64le) cannot be installed via this path, so mise refuses before running apk.","triggerScenarios":"`mise oci build` targeting a platform other than linux/amd64 or linux/arm64 (e.g. `--platform linux/riscv64`) while `[bootstrap.packages.apk]` entries are present.","commonSituations":"Building images for ARMv7 boards or SBCs where Alpine does ship packages but mise's OCI path has no arch mapping.","solutions":["Restrict oci builds that carry apk entries to linux/amd64 or linux/arm64","Drop the `[bootstrap.packages.apk]` table for other platforms and preinstall packages in the base image for those targets","Use a Dockerfile-based build for the unsupported platform instead of mise oci system packages"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Gate apk-backed oci builds on supported platforms before invoking mise.\nfn platform_supports_apk_packages(oci_arch: &str) -> bool {\n    matches!(oci_arch, \"amd64\" | \"x86_64\" | \"arm64\" | \"aarch64\")\n}\n\nif !platform_supports_apk_packages(&target_arch) {\n    eprintln!(\"skipping [bootstrap.packages.apk]: {target_arch} unsupported\");\n}","typeGuard":"fn apk_arch_supported(oci_arch: &str) -> bool {\n    matches!(oci_arch, \"amd64\" | \"x86_64\" | \"arm64\" | \"aarch64\")\n}","tryCatchPattern":null,"preventionTips":["Restrict multi-arch matrices to amd64/arm64 when using apk system packages","Use base images with preinstalled packages for other architectures"],"tags":["mise","oci","apk","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"}