BoundaryML/baml · error
pack produced no output at {}
Error message
pack produced no output at {} What it means
After `baml pack` exits successfully, run_baml_pack verifies the output file actually exists at the deterministic path under target/size-gate/. If the CLI exited 0 but wrote nothing (or wrote elsewhere), this bail catches it, protecting the measurement step from operating on a missing artifact.
Source
Thrown at baml_language/crates/tools_size_gate/src/measure.rs:152
}
eprintln!(" packing {} -> {}", pack.function, output.display());
let status = Command::new(&cli_path)
.arg("pack")
.arg("--file")
.arg(&fixture)
.arg(&pack.function)
.arg("-o")
.arg(&output)
.current_dir(workspace_root)
.status()
.with_context(|| format!("failed to run {} pack", cli_path.display()))?;
if !status.success() {
bail!("`baml pack` failed for fixture {}", fixture.display());
}
if !output.exists() {
bail!("pack produced no output at {}", output.display());
}
Ok(output)
}
/// Deterministic output path for a packed artifact.
fn pack_output_path(workspace_root: &Path, name: &str) -> PathBuf {
workspace_root
.join("target/size-gate")
.join(exe_filename(name))
}
/// Find the built artifact in the target directory (public for --no-build mode).
pub(crate) fn locate_artifact_public(
workspace_root: &Path,
name: &str,
config: &ArtifactConfig,
) -> Result<PathBuf> {
locate_artifact(workspace_root, name, config)View on GitHub (pinned to bd85ce9dee)
Solutions
- Inspect target/size-gate/ to see where output actually landed
- Confirm the CLI version supports -o and writes to it exactly
- Re-run after freeing disk space / ruling out concurrent cargo clean
- Run the pack command manually and check the exit code and output path
Example fix
// before: old CLI ignores -o baml pack -i fixture -o out # exits 0, no file // after baml --version # ensure >= version that honors -o, then rerun size-gate
Defensive patterns
Strategy: validation
Validate before calling
let out = pack_output_path(workspace, name);
if !out.exists() {
eprintln!("pack output missing at {} — check CLI version supports -o", out.display());
std::process::exit(1);
} Prevention
- Pin a baml CLI version whose pack command honors -o
- Confirm the output path in the error matches your expectations (target/size-gate/)
- Watch free disk space in CI; add a check before measuring
- Prevent concurrent cargo clean while size-gate runs
When it happens
Trigger: Pack CLI exits 0 without producing the output: -o path ignored by an older CLI version, pack writes to a different directory, or the CLI silently skips on empty/invalid input.
Common situations: Using a baml CLI version whose pack flag semantics differ; disk full silently truncating output; output path cleaned concurrently by another CI job running cargo clean.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- no `.baml` files found in {}
- Schema inconsistency: {message}
- `baml pack` failed for fixture {}
- Internal error occurred while resolving repr of field {:?}
- InternalError
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/c0be2b1914c25d09.
Report an issue: GitHub.