BoundaryML/baml · error

target {target} not built for version {}

Error message

target {target} not built for version {}

What it means

ReleaseManifest::artifact_for_target looks up the requested target triple in the manifest's artifacts map. When the map has no entry for that target it returns "target {target} not built for version {version}", meaning the release simply has no binary published for that platform. This is a data lookup failure, not a validation error.

Source

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

                },
            )?;
        }
        if let Some(cffi) = &self.cffi {
            for (target, artifact) in cffi {
                validate_artifact(&format!("cffi/{target}"), artifact)?;
            }
        }
        if let Some(sdks) = &self.sdks {
            for (language, package) in sdks {
                validate_sdk(language, package)?;
            }
        }
        Ok(())
    }

    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)
        })
    }
}

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Choose a target that exists in the manifest (list `manifest.artifacts` keys to see what's built).
  2. Use a newer release version that includes builds for your target.
  3. Fix typos in the requested target triple.
  4. If you control the release pipeline, ensure the target is added to the build matrix.

Example fix

// before
let artifact = manifest.artifact_for_target("aarch64-unknown-linux-musl")?; // v0.100 has no musl build
// after
let artifact = manifest.artifact_for_target("aarch64-unknown-linux-gnu")?; // or upgrade version
Defensive patterns

Strategy: fallback

Validate before calling

if !manifest.artifacts.contains_key(target) {
    eprintln!("{} not built for {}; available: {:?}", target, manifest.version, manifest.artifacts.keys());
}

Try / catch

match manifest.artifact_for_target(target) {
    Ok(a) => a,
    Err(_) => manifest.artifact_for_target(fallback_target)
        .or_else(|_| Err(pick_supported_version())),
}

Prevention

When it happens

Trigger: Calling artifact_for_target(target) on a ReleaseManifest whose artifacts BTreeMap lacks that key — e.g. requesting a target the CI didn't build for that release version, or a typo'd target string.

Common situations: Pinning an older BAML version that predates aarch64-linux builds; querying an exotic target (musl variants) not shipped; typos in toolchain config specifying a target for a given version.

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/8559f57bef1d9544. Report an issue: GitHub.