{"record":{"id":"9550f58498ab54d1","repo":"BoundaryML/baml","slug":"unsupported-pack-target-target-err","errorCode":null,"errorMessage":"unsupported pack target `{target}`. {err}","messagePattern":"unsupported pack target `(.+?)`\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/pack_command.rs","lineNumber":627,"sourceCode":"    fetcher\n        .fetch_binary(host_name)\n        .map_err(|err| anyhow!(\"{err}\"))\n}\n\nfn release_version_for_download() -> String {\n    std::env::var(\"BAML_PACK_HOST_RELEASE_VERSION\")\n        .ok()\n        .filter(|v| !v.trim().is_empty())\n        .unwrap_or_else(|| release_version().to_string())\n}\n\nfn release_host_target_triple() -> Result<&'static str> {\n    baml_release::release_host_target_triple()\n}\n\nfn validate_release_target_triple(target: &str) -> Result<&str> {\n    baml_release::validate_release_target_triple(target)\n        .map_err(|err| anyhow!(\"unsupported pack target `{target}`. {err}\"))\n}\n\n/// Heuristic: does this positional `<TARGET>` look like a filesystem\n/// path rather than a function name? Triggers when the user typed\n/// something like `baml_src/main.baml` and we want to redirect them to\n/// `--file`. Function names can't contain `/` or `\\`, and the `.baml`\n/// suffix is the strong signal — namespaced functions like `llm.Foo`\n/// use `.` but never end in `.baml`.\nfn looks_like_path(target: &str) -> bool {\n    target.contains('/') || target.contains('\\\\') || target.ends_with(\".baml\")\n}\n\nfn default_output_path(default_basename: &str, target_triple: &str) -> PathBuf {\n    let mut path = PathBuf::from(default_basename);\n    if target_triple.ends_with(\"windows-msvc\")\n        && path.extension().and_then(|ext| ext.to_str()) != Some(\"exe\")\n    {\n        path.set_extension(\"exe\");","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/pack_command.rs#L609-L645","documentation":"`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.","triggerScenarios":"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`.","commonSituations":"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.","solutions":["Run `rustc -vV` (or check the releases page) and use one of the exact supported triples for the host binary.","Fix typos in arch/OS naming — e.g. use `x86_64-unknown-linux-gnu`, `aarch64-apple-darwin`, `x86_64-pc-windows-msvc` style triples.","If you passed a function/file path by mistake, move it after `--file`/`--from` instead of the `<TARGET>` position.","Read the `{err}` suffix in the message — it contains the validator's list/details of acceptable targets."],"exampleFix":"// before\n$ baml pack x86_64-apple-darwin13 myFn\n// after\n$ baml pack aarch64-apple-darwin myFn --from baml_src","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[&str] = &[\n    \"x86_64-unknown-linux-gnu\", \"aarch64-unknown-linux-gnu\",\n    \"aarch64-apple-darwin\", \"x86_64-apple-darwin\", \"x86_64-pc-windows-msvc\",\n];\nfn is_supported_target(t: &str) -> bool { SUPPORTED.contains(&t) }","typeGuard":"fn looks_like_target_triple(s: &str) -> bool {\n    let parts: Vec<&str> = s.split('-').collect();\n    parts.len() >= 2 && !s.contains('/') && !s.ends_with(\".baml\")\n}","tryCatchPattern":"match baml pack \"$TARGET\" ... {\n  case *unsupported*pack*target*:\n    echo \"Run: baml pack --list-targets (or check validator output after the message) and retry\"\n}","preventionTips":["Copy target triples from the official docs/releases page instead of typing from memory.","Never put a file path in the `<TARGET>` position — use `--file`/`--from` for paths and function names.","Validate with `validate_release_target_triple` (or a dry run) before a long packing operation.","Keep a checked-in CI matrix of exact triples used for releases."],"tags":["rust","cli","argument-validation","target-triple"],"backgroundTag":"invalid-argument-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}