BoundaryML/baml · error
pack fixture not found at {}
Error message
pack fixture not found at {} What it means
Before running `baml pack`, run_baml_pack checks that the configured fixture (pack.fixture, resolved relative to the workspace root) exists on disk. If not, it bails with the full path. The fixture is the sample input that gets packed to produce a measurable artifact.
Source
Thrown at baml_language/crates/tools_size_gate/src/measure.rs:127
);
}
run_baml_pack(workspace_root, name, pack)
}
/// Run the freshly built CLI's `baml pack` on the fixture, writing the
/// output to a deterministic path under `target/size-gate/`.
fn run_baml_pack(workspace_root: &Path, name: &str, pack: &PackConfig) -> Result<PathBuf> {
let cli_path = workspace_root
.join("target/release")
.join(exe_filename(&pack.cli_bin));
if !cli_path.exists() {
bail!("pack CLI not found at {}", cli_path.display());
}
let fixture = workspace_root.join(&pack.fixture);
if !fixture.exists() {
bail!("pack fixture not found at {}", fixture.display());
}
let output = pack_output_path(workspace_root, name);
if let Some(parent) = output.parent() {
std::fs::create_dir_all(parent)
.with_context(|| format!("failed to create {}", parent.display()))?;
}
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()View on GitHub (pinned to bd85ce9dee)
Solutions
- Check the file exists at the path printed in the error
- Fix the `fixture` path in the pack config to match the repo layout
- Restore the missing fixture file or initialize submodules if applicable
- Ensure the path is relative to the workspace root, not your cwd
Example fix
// before: fixture moved fixture = "fixtures/old-sample.baml" // after fixture = "fixtures/sample.baml"
Defensive patterns
Strategy: validation
Validate before calling
let fixture = workspace.join(&pack.fixture);
if !fixture.exists() {
eprintln!("fixture missing: {}", fixture.display());
std::process::exit(1);
} Prevention
- Keep fixture paths in the size-gate config relative to the workspace root
- Update pack config whenever fixtures move or are renamed
- Use a CI preflight check that all configured fixtures exist
- If fixtures live in submodules, ensure submodules are initialized in CI
When it happens
Trigger: The path in PackConfig.fixture does not exist relative to the workspace root: typo in config, fixture file moved/deleted, or running from a different checkout lacking the fixture.
Common situations: Renaming or relocating test fixtures without updating the size-gate pack config; cloning a partial repo (submodules not initialized); misconfigured relative path (e.g. leading / or wrong depth).
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
- artifact `{name}` (kind = "pack") sets `{field}`, which is i
- pack CLI not found at {}
- toolchain binary not found: {}{origin}
- BAML toolchain {version} is not installed
- {} uses reserved table `[__baml_codegen]`; remove it because
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/700a501aac910e56.
Report an issue: GitHub.