{"record":{"id":"df67f2d1294a3b81","repo":"jdx/mise","slug":"mise-oci-build-does-not-support-asdf-vfox-plugins","errorCode":null,"errorMessage":"mise oci build does not support asdf/vfox plugins in v1 (their install scripts can write outside the per-version directory, breaking the one-layer-per-tool invariant). Affected tools: {}","messagePattern":"mise oci build does not support asdf/vfox plugins in v1 \\(their install scripts can write outside the per-version directory, breaking the one-layer-per-tool invariant\\)\\. Affected tools: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/builder.rs","lineNumber":1195,"sourceCode":"fn reject_unsupported_backends(\n    versions: &[(Arc<dyn crate::backend::Backend>, ToolVersion)],\n) -> Result<()> {\n    // Ask the actual backend instance rather than parsing the short name.\n    // `BackendType::guess` only matches literal \"asdf\" / \"vfox\" prefixes and\n    // misses third-party vfox plugins whose tools use a custom plugin name\n    // as the prefix (e.g. `my-plugin:tool`), even though they have the same\n    // out-of-tree write behavior we're guarding against.\n    let bad: Vec<String> = versions\n        .iter()\n        .filter_map(|(backend, tv)| match backend.get_type() {\n            BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_) => {\n                Some(tv.ba().short.clone())\n            }\n            _ => None,\n        })\n        .collect();\n    if !bad.is_empty() {\n        bail!(\n            \"mise oci build does not support asdf/vfox plugins in v1 (their install scripts can \\\n             write outside the per-version directory, breaking the one-layer-per-tool invariant). \\\n             Affected tools: {}\",\n            bad.join(\", \")\n        );\n    }\n    Ok(())\n}\n\n/// Rewrite any occurrence of the host install path in an `exec_env` value to\n/// the corresponding in-image path. Handles both exact matches\n/// (`JAVA_HOME=<install>`) and colon-separated PATH-like values\n/// (`SOMETHING=<install>/foo:<install>/bar`).\nfn rebase_path_value(value: &str, host_prefix: &std::path::Path, in_image_prefix: &str) -> String {\n    let host: &str = &host_prefix.to_string_lossy();\n    if host.is_empty() || !value.contains(host) {\n        return value.to_string();\n    }","sourceCodeStart":1177,"sourceCodeEnd":1213,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/builder.rs#L1177-L1213","documentation":"`mise oci build` refuses to build an OCI image when any tool in the requested toolset is backed by an asdf or vfox plugin. Such plugins run arbitrary install scripts that may write outside the tool's per-version install directory, which would break the one-layer-per-tool layout invariant the OCI builder relies on. The error lists the offending tool short names so you can see exactly which entries to remove or replace.","triggerScenarios":"Calling `mise oci build` (the `build` function) with a toolset whose versions resolve to a backend of type `BackendType::Asdf`, `BackendType::Vfox`, or `BackendType::VfoxBackend(_)` — e.g. an .tool-versions/mise.toml entry using an asdf plugin or a third-party vfox plugin like `my-plugin:tool`.","commonSituations":"Users with legacy asdf plugins in their global config; teams using internal vfox plugins; migrating an existing mise toolset that mixes core/aqua/github tools with asdf/vfox tools into an image build.","solutions":["Remove the asdf/vfox-backed tools from the toolset used for the image build (the error lists them in 'Affected tools').","Replace each affected tool with an equivalent backend that installs cleanly into one directory, e.g. aqua:, github:, or a core plugin version.","Install the asdf/vfox tools manually in a later build/dockerfile step instead of through `mise oci build`."],"exampleFix":"// before (mise.toml used for oci build)\n[tools]\nnode = \"22\"\n\"my-plugin:foo\" = \"1.0\"  # vfox plugin -> rejected\n\n// after\n[tools]\nnode = \"22\"\nfoo = { version = \"1.0\", backend = \"github:org/foo\" }","handlingStrategy":"validation","validationCode":"// Before oci build, inspect the resolved toolset for asdf/vfox backends\nlet bad: Vec<_> = toolset\n    .versions()\n    .iter()\n    .filter(|(b, _)| matches!(b.get_type(), BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_)))\n    .map(|(_, tv)| tv.ba().short.clone())\n    .collect();\nif !bad.is_empty() {\n    eprintln!(\"unsupported for oci build: {}\", bad.join(\", \"));\n}","typeGuard":"fn is_layer_safe_backend(b: &dyn Backend) -> bool {\n    !matches!(b.get_type(), BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_))\n}","tryCatchPattern":null,"preventionTips":["Keep OCI image toolsets on core/aqua/github/packslip backends only.","Maintain a separate mise.toml for image builds without asdf/vfox entries.","Document internal vfox plugins as incompatible with `mise oci build`."],"tags":["oci","build","unsupported-backend","asdf","vfox"],"backgroundTag":"unsupported-operation","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"}