BoundaryML/baml · error · std::io::Error

compile produced no assembled units

Error message

compile produced no assembled units

What it means

Internal invariant failure while writing compiled artifacts to the bytecode cache: store_artifacts_with_manifest was called with a CompiledArtifacts whose assembled-units list is empty. Every cached compile assembles units alongside the program, so an empty list means the caller passed an incomplete artifact bundle — a programmer error inside the CLI, not a user-input problem. The store is aborted and reported like any cache store failure.

Source

Thrown at baml_language/crates/baml_cli/src/bytecode_cache.rs:1573

    ///
    /// `compiled` must carry assembled units: every cached compile assembles
    /// them alongside the program, so a store without them is a programmer
    /// error, reported the way every store failure is (the compile itself
    /// succeeded; release builds degrade to an uncached run).
    pub(crate) fn store_artifacts_with_manifest(
        &self,
        db: &ProjectDatabase,
        package: SourceRoot,
        compiled: &CompiledArtifacts,
        fresh_by_file: &std::collections::BTreeMap<String, Vec<u8>>,
        plan: Option<&ReusePlan>,
    ) -> std::io::Result<CacheStoreStats> {
        let (units, reused_units): (&[CompilationUnit], bool) = match &compiled.units {
            CompiledUnits::Fresh(units) => (units, false),
            CompiledUnits::Reused(units) => (units, true),
            CompiledUnits::None => {
                debug_assert!(false, "cached compile stored without assembled units");
                return Err(std::io::Error::new(
                    std::io::ErrorKind::InvalidData,
                    "compile produced no assembled units",
                ));
            }
        };
        self.store(&compiled.program)?;

        let mut units_by_source = HashMap::with_capacity(units.len());
        for unit in units {
            if units_by_source
                .insert(unit.source_file.as_str(), unit)
                .is_some()
            {
                return Err(std::io::Error::new(
                    std::io::ErrorKind::InvalidData,
                    format!("duplicate compilation unit for `{}`", unit.source_file),
                ));
            }

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Update baml — this is a bug in the CLI's cache-store path, not in project sources
  2. As a workaround, disable the bytecode cache (BAML_NO_CACHE or equivalent) so the uncached compile path runs
  3. Report the issue to the BAML maintainers with the command that triggered it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at baml_language/crates/baml_cli/src/bytecode_cache.rs:1573 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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