{"record":{"id":"bc7bc1396edf3994","repo":"jdx/mise","slug":"oci-system-package-layers-with-symlinks-require-a","errorCode":null,"errorMessage":"OCI system package layers with symlinks require a unix host","messagePattern":"OCI system package layers with symlinks require a unix host","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":749,"sourceCode":"    if let Some(parent) = dst.parent() {\n        file::create_dir_all(parent)?;\n    }\n    match &entry.kind {\n        FsEntryKind::Dir => {\n            file::create_dir_all(&dst)?;\n            set_mode(&dst, entry.mode)?;\n        }\n        FsEntryKind::File { .. } => {\n            file::copy(&src, &dst)?;\n            set_mode(&dst, entry.mode)?;\n        }\n        FsEntryKind::Symlink { target } => {\n            #[cfg(unix)]\n            symlink(target, &dst)?;\n            #[cfg(not(unix))]\n            {\n                let _ = target;\n                bail!(\"OCI system package layers with symlinks require a unix host\");\n            }\n        }\n        FsEntryKind::Other => {\n            warn!(\n                \"oci: skipping unsupported filesystem entry {}\",\n                src.display()\n            );\n        }\n    }\n    Ok(())\n}\n\nfn set_mode(path: &Path, mode: u32) -> Result<()> {\n    #[cfg(unix)]\n    fs::set_permissions(path, fs::Permissions::from_mode(mode))?;\n    #[cfg(not(unix))]\n    {\n        let _ = (path, mode);","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/oci/packages.rs#L731-L767","documentation":"After installing packages, mise diffs the rootfs snapshot and re-materializes changed entries into the new layer directory. Symlinks in that diff (very common from apk/apt alternatives and busybox links) can only be recreated with unix symlink(2); on a non-unix host (Windows) there is no equivalent, so any symlink in the diff aborts the build.","triggerScenarios":"Running `mise oci build` with `[bootstrap.packages]` entries on Windows, where the installed packages create at least one symlink in the filesystem diff (e.g. /usr/bin/vi → busybox, alternatives links like /etc/alternatives/editor).","commonSituations":"Developers on Windows workstations building OCI images with system packages; the apk path already hard-requires a Linux host, so this typically fires via the apt path on Windows.","solutions":["Run the oci build in WSL2 or a Linux CI container — that is the supported environment for system-package layers","Alternatively use a base image that already contains the packages, so no [bootstrap.packages] diff is needed on Windows","Avoid packages known to create alternatives symlinks if you must build on Windows without system packages"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before enabling [bootstrap.packages] on this host, require unix:\nif cfg!(not(unix)) {\n    eprintln!(\"oci system-package layers need a unix host (run in WSL2/Linux CI)\");\n    // skip the packages table or abort before `mise oci build`\n}","typeGuard":"fn can_materialize_symlinks() -> bool {\n    cfg!(unix)\n}","tryCatchPattern":null,"preventionTips":["Run oci builds with [bootstrap.packages] in WSL2 or Linux CI containers on Windows workstations","If Windows builds are mandatory, bake packages into the base image so no symlink-bearing diff is generated"],"tags":["mise","oci","windows","symlink","platform-unsupported","cross-platform"],"backgroundTag":"symlink-unsupported-platform","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}