{"record":{"id":"43b72109c8c2cbae","repo":"BoundaryML/baml","slug":"pack-cli-not-found-at","errorCode":null,"errorMessage":"pack CLI not found at {}","messagePattern":"pack CLI not found at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/tools_size_gate/src/measure.rs","lineNumber":122,"sourceCode":"    if !status.success() {\n        bail!(\n            \"cargo build failed for pack ({} + {})\",\n            pack.cli_package,\n            pack.host_package\n        );\n    }\n\n    run_baml_pack(workspace_root, name, pack)\n}\n\n/// Run the freshly built CLI's `baml pack` on the fixture, writing the\n/// output to a deterministic path under `target/size-gate/`.\nfn run_baml_pack(workspace_root: &Path, name: &str, pack: &PackConfig) -> Result<PathBuf> {\n    let cli_path = workspace_root\n        .join(\"target/release\")\n        .join(exe_filename(&pack.cli_bin));\n    if !cli_path.exists() {\n        bail!(\"pack CLI not found at {}\", cli_path.display());\n    }\n\n    let fixture = workspace_root.join(&pack.fixture);\n    if !fixture.exists() {\n        bail!(\"pack fixture not found at {}\", fixture.display());\n    }\n\n    let output = pack_output_path(workspace_root, name);\n    if let Some(parent) = output.parent() {\n        std::fs::create_dir_all(parent)\n            .with_context(|| format!(\"failed to create {}\", parent.display()))?;\n    }\n\n    eprintln!(\"  packing {} -> {}\", pack.function, output.display());\n    let status = Command::new(&cli_path)\n        .arg(\"pack\")\n        .arg(\"--file\")\n        .arg(&fixture)","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/tools_size_gate/src/measure.rs#L104-L140","documentation":"run_baml_pack expects the freshly built CLI binary at target/release/<exe_filename(cli_bin)> inside the workspace. If that file does not exist, it bails with the resolved path. This means the pack step's build didn't produce the expected binary where the config expects it.","triggerScenarios":"Building the pack binaries did not emit target/release/<cli_bin> — wrong cli_bin name in the pack config, build ran in debug mode or another --target dir, or the release binary is on a triple-suffixed path when cross-compiling.","commonSituations":"CARGO_TARGET_DIR set to a non-default location; cross-compiling so the binary lands in target/<triple>/release; cli_bin renamed; build silently skipped (e.g. cargo build error handled earlier).","solutions":["Verify target/release/<cli_bin> exists after the build step in the workspace root","Unset CARGO_TARGET_DIR or align pack_output_path with the custom target dir","Check the cli_bin name in the pack config matches the actual bin in Cargo.toml","If cross-compiling, ensure the config expects target/<triple>/release and adjust"],"exampleFix":"// before: CARGO_TARGET_DIR misplaces the binary\nCARGO_TARGET_DIR=./out size-gate measure ...\n// after\nunset CARGO_TARGET_DIR && size-gate measure ...","handlingStrategy":"validation","validationCode":"let cli = workspace.join(\"target/release\").join(exe_filename(cli_bin));\nif !cli.exists() { eprintln!(\"expected release binary missing: {}\", cli.display()); std::process::exit(1); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not set CARGO_TARGET_DIR when running size-gate","Avoid cross-compiling for measurement, or adjust paths for target/<triple>/release","After renaming bins, update the pack config in the same commit","Add a post-build assertion that the binary path exists"],"tags":["file-not-found","cargo","binary","size-gate"],"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-14T11:17:12.474Z"}