BoundaryML/baml · error

unsupported pack target `{target}`. {err}

Error message

unsupported pack target `{target}`. {err}

What it means

`validate_release_target_triple` delegates to `baml_release::validate_release_target_triple` and, on failure, wraps the underlying error as `unsupported pack target `{target}`. {err}`. It means the `<TARGET>` triple passed to the pack command is not one the release toolchain knows how to build or fetch artifacts for.

Source

Thrown at baml_language/crates/baml_cli/src/pack_command.rs:627

    fetcher
        .fetch_binary(host_name)
        .map_err(|err| anyhow!("{err}"))
}

fn release_version_for_download() -> String {
    std::env::var("BAML_PACK_HOST_RELEASE_VERSION")
        .ok()
        .filter(|v| !v.trim().is_empty())
        .unwrap_or_else(|| release_version().to_string())
}

fn release_host_target_triple() -> Result<&'static str> {
    baml_release::release_host_target_triple()
}

fn validate_release_target_triple(target: &str) -> Result<&str> {
    baml_release::validate_release_target_triple(target)
        .map_err(|err| anyhow!("unsupported pack target `{target}`. {err}"))
}

/// Heuristic: does this positional `<TARGET>` look like a filesystem
/// path rather than a function name? Triggers when the user typed
/// something like `baml_src/main.baml` and we want to redirect them to
/// `--file`. Function names can't contain `/` or `\`, and the `.baml`
/// suffix is the strong signal — namespaced functions like `llm.Foo`
/// use `.` but never end in `.baml`.
fn looks_like_path(target: &str) -> bool {
    target.contains('/') || target.contains('\\') || target.ends_with(".baml")
}

fn default_output_path(default_basename: &str, target_triple: &str) -> PathBuf {
    let mut path = PathBuf::from(default_basename);
    if target_triple.ends_with("windows-msvc")
        && path.extension().and_then(|ext| ext.to_str()) != Some("exe")
    {
        path.set_extension("exe");

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Run `rustc -vV` (or check the releases page) and use one of the exact supported triples for the host binary.
  2. Fix typos in arch/OS naming — e.g. use `x86_64-unknown-linux-gnu`, `aarch64-apple-darwin`, `x86_64-pc-windows-msvc` style triples.
  3. If you passed a function/file path by mistake, move it after `--file`/`--from` instead of the `<TARGET>` position.
  4. Read the `{err}` suffix in the message — it contains the validator's list/details of acceptable targets.

Example fix

// before
$ baml pack x86_64-apple-darwin13 myFn
// after
$ baml pack aarch64-apple-darwin myFn --from baml_src
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: &[&str] = &[
    "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu",
    "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc",
];
fn is_supported_target(t: &str) -> bool { SUPPORTED.contains(&t) }

Type guard

fn looks_like_target_triple(s: &str) -> bool {
    let parts: Vec<&str> = s.split('-').collect();
    parts.len() >= 2 && !s.contains('/') && !s.ends_with(".baml")
}

Try / catch

match baml pack "$TARGET" ... {
  case *unsupported*pack*target*:
    echo "Run: baml pack --list-targets (or check validator output after the message) and retry"
}

Prevention

When it happens

Trigger: Calling `baml pack <TARGET> ...` with a positional target that isn't a supported release triple (typo, wrong arch/OS naming, or a filesystem path mistaken for a target — hence the adjacent heuristic detecting paths like `baml_src/main.baml`); also exercised directly by `test_validate_release_target_triple_rejects_unknown_target`.

Common situations: Typos like `x86_64-apple-darwin13` or `aarch64-linux`; using `x86_64-pc-windows` instead of `...-msvc`; accidentally passing a `.baml` file path where `<TARGET>` is expected; targeting a platform BAML doesn't publish host binaries for.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/9550f58498ab54d1. Report an issue: GitHub.