jdx/mise · error

mise oci build does not support asdf/vfox plugins in v1…

Error message

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: {}

What it means

`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.

Solutions

  1. Remove the asdf/vfox-backed tools from the toolset used for the image build (the error lists them in 'Affected tools').
  2. Replace each affected tool with an equivalent backend that installs cleanly into one directory, e.g. aqua:, github:, or a core plugin version.
  3. Install the asdf/vfox tools manually in a later build/dockerfile step instead of through `mise oci build`.

Example fix

// before (mise.toml used for oci build)
[tools]
node = "22"
"my-plugin:foo" = "1.0"  # vfox plugin -> rejected

// after
[tools]
node = "22"
foo = { version = "1.0", backend = "github:org/foo" }
Defensive patterns

Strategy: validation

Validate before calling

// Before oci build, inspect the resolved toolset for asdf/vfox backends
let bad: Vec<_> = toolset
    .versions()
    .iter()
    .filter(|(b, _)| matches!(b.get_type(), BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_)))
    .map(|(_, tv)| tv.ba().short.clone())
    .collect();
if !bad.is_empty() {
    eprintln!("unsupported for oci build: {}", bad.join(", "));
}

Type guard

fn is_layer_safe_backend(b: &dyn Backend) -> bool {
    !matches!(b.get_type(), BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_))
}

Prevention

When it happens

Trigger: 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`.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/df67f2d1294a3b81. Report an issue: GitHub.

Appendix: source

Thrown at src/oci/builder.rs:1195

fn reject_unsupported_backends(
    versions: &[(Arc<dyn crate::backend::Backend>, ToolVersion)],
) -> Result<()> {
    // Ask the actual backend instance rather than parsing the short name.
    // `BackendType::guess` only matches literal "asdf" / "vfox" prefixes and
    // misses third-party vfox plugins whose tools use a custom plugin name
    // as the prefix (e.g. `my-plugin:tool`), even though they have the same
    // out-of-tree write behavior we're guarding against.
    let bad: Vec<String> = versions
        .iter()
        .filter_map(|(backend, tv)| match backend.get_type() {
            BackendType::Asdf | BackendType::Vfox | BackendType::VfoxBackend(_) => {
                Some(tv.ba().short.clone())
            }
            _ => None,
        })
        .collect();
    if !bad.is_empty() {
        bail!(
            "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: {}",
            bad.join(", ")
        );
    }
    Ok(())
}

/// Rewrite any occurrence of the host install path in an `exec_env` value to
/// the corresponding in-image path. Handles both exact matches
/// (`JAVA_HOME=<install>`) and colon-separated PATH-like values
/// (`SOMETHING=<install>/foo:<install>/bar`).
fn rebase_path_value(value: &str, host_prefix: &std::path::Path, in_image_prefix: &str) -> String {
    let host: &str = &host_prefix.to_string_lossy();
    if host.is_empty() || !value.contains(host) {
        return value.to_string();
    }

View on GitHub (pinned to 533346cc37)