{"record":{"id":"c0be2b1914c25d09","repo":"BoundaryML/baml","slug":"pack-produced-no-output-at","errorCode":null,"errorMessage":"pack produced no output at {}","messagePattern":"pack produced no output at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/tools_size_gate/src/measure.rs","lineNumber":152,"sourceCode":"    }\n\n    eprintln!(\"  packing {} -> {}\", pack.function, output.display());\n    let status = Command::new(&cli_path)\n        .arg(\"pack\")\n        .arg(\"--file\")\n        .arg(&fixture)\n        .arg(&pack.function)\n        .arg(\"-o\")\n        .arg(&output)\n        .current_dir(workspace_root)\n        .status()\n        .with_context(|| format!(\"failed to run {} pack\", cli_path.display()))?;\n    if !status.success() {\n        bail!(\"`baml pack` failed for fixture {}\", fixture.display());\n    }\n\n    if !output.exists() {\n        bail!(\"pack produced no output at {}\", output.display());\n    }\n    Ok(output)\n}\n\n/// Deterministic output path for a packed artifact.\nfn pack_output_path(workspace_root: &Path, name: &str) -> PathBuf {\n    workspace_root\n        .join(\"target/size-gate\")\n        .join(exe_filename(name))\n}\n\n/// Find the built artifact in the target directory (public for --no-build mode).\npub(crate) fn locate_artifact_public(\n    workspace_root: &Path,\n    name: &str,\n    config: &ArtifactConfig,\n) -> Result<PathBuf> {\n    locate_artifact(workspace_root, name, config)","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/tools_size_gate/src/measure.rs#L134-L170","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before: old CLI ignores -o\nbaml pack -i fixture -o out   # exits 0, no file\n// after\nbaml --version   # ensure >= version that honors -o, then rerun size-gate","handlingStrategy":"validation","validationCode":"let out = pack_output_path(workspace, name);\nif !out.exists() {\n    eprintln!(\"pack output missing at {} — check CLI version supports -o\", out.display());\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["file-not-found","baml","pack","invariant"],"backgroundTag":"file-not-found","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"}