{"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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":627,"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":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/packages.rs#L609-L645","documentation":"`apt_architecture` maps OCI architecture names to Debian apt architecture strings and only supports amd64 and arm64. Requesting apt system packages for any other OCI architecture (e.g. riscv64, ppc64le, s390x, 386) bails with this error.","triggerScenarios":"Building an OCI image with apt entries in `[bootstrap.packages]` while the target platform architecture is anything other than amd64/x86_64/arm64/aarch64, evaluated in `prepare_and_snapshot` -> `apt_architecture`.","commonSituations":"Cross-building images for less common architectures (s390x on IBM Z, ppc64le, riscv64); miscapitalized or aliased arch strings in the platform config.","solutions":["Build only for amd64 or arm64 when apt system packages are declared.","Remove apt entries from `[bootstrap.packages]` for unsupported architectures, or split configs per architecture.","Use an apk (Alpine/Wolfi) base if Alpine supports your target arch; note apk supports the same pair today."],"exampleFix":"# before\n# mise oci build --platform linux/riscv64  with apt packages\n\n# after\n# mise oci build --platform linux/amd64","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['amd64', 'x86_64', 'arm64', 'aarch64'];\nif ((cfg.bootstrap?.packages?.apt ?? []).length > 0 && !SUPPORTED.includes(targetArch)) throw new Error(`apt packages unsupported for arch ${targetArch}; build for amd64/arm64`);","typeGuard":"const aptArchSupported = (arch) => ['amd64', 'x86_64', 'arm64', 'aarch64'].includes(arch);","tryCatchPattern":"try { await miseOciBuild(cfg) } catch (e) { if (String(e).includes('apt system packages are not supported for OCI architecture')) { console.error('Restrict the build platform to linux/amd64 or linux/arm64.'); process.exit(1); } throw e; }","preventionTips":["Pin build platforms to linux/amd64 and linux/arm64 when apt packages are declared.","Keep per-architecture configs if you must build multi-arch.","Check `uname -m` / platform flag before CI matrix jobs."],"tags":["architecture","apt","oci","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}