BoundaryML/baml · error

target {target} not built for wrapper {}

Error message

target {target} not built for wrapper {}

What it means

WrapperManifest::artifact_for_target performs the same lookup as the release manifest version but against the wrapper's own artifact map, reporting "target {target} not built for wrapper {version}" when absent. The wrapper manifest ships the binaries bundled with a specific wrapper release, so a missing entry means that wrapper version never included the requested target.

Source

Thrown at baml_language/crates/baml_release/src/manifest.rs:122

    }

    pub fn artifact_for_target(&self, target: &str) -> anyhow::Result<&Artifact> {
        self.artifacts.get(target).ok_or_else(|| {
            anyhow::anyhow!("target {target} not built for version {}", self.version)
        })
    }
}

#[cfg(all(feature = "self-update", not(feature = "no-self-update")))]
impl WrapperManifest {
    pub fn validate(&self) -> anyhow::Result<()> {
        validate_schema(self.schema)?;
        validate_artifacts(&self.version, &self.artifacts)
    }

    pub fn artifact_for_target(&self, target: &str) -> anyhow::Result<&Artifact> {
        self.artifacts.get(target).ok_or_else(|| {
            anyhow::anyhow!("target {target} not built for wrapper {}", self.version)
        })
    }
}

fn validate_schema(schema: u32) -> anyhow::Result<()> {
    if schema > MANIFEST_SCHEMA {
        anyhow::bail!(
            "manifest schema {schema} is newer than this wrapper; run `baml self-update`"
        );
    }
    if schema != MANIFEST_SCHEMA {
        anyhow::bail!("unsupported manifest schema {schema}");
    }
    Ok(())
}

fn validate_artifacts(version: &str, artifacts: &BTreeMap<String, Artifact>) -> anyhow::Result<()> {
    let expected: std::collections::BTreeSet<_> =

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Use a target present in the wrapper's artifacts map.
  2. Update the wrapper (`baml self-update`) to a version that includes the target.
  3. Correct any typo in the target argument.
  4. Add the target to the wrapper build matrix if you own packaging.

Example fix

// before
wrapper.artifact_for_target("x86_64-pc-windows-msvc")?; // wrapper built only for linux
// after
baml self-update;
wrapper.artifact_for_target("x86_64-pc-windows-msvc")?;
Defensive patterns

Strategy: fallback

Validate before calling

if !wrapper.artifacts.contains_key(target) {
    eprintln!("wrapper {} lacks {}; run baml self-update", wrapper.version);
}

Try / catch

match wrapper.artifact_for_target(target) {
    Err(_) => { run_self_update(); retry_with_fresh_wrapper(); }
    ok => ok,
}

Prevention

When it happens

Trigger: Calling artifact_for_target on a WrapperManifest for a target absent from its artifacts — requesting a platform the wrapper build didn't embed, or a mistyped target string.

Common situations: Older wrapper installs queried for targets added later; Docker images built for one arch asked to serve another; typos in toolchain/config files.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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