{"record":{"id":"dfdf54210f7d7167","repo":"heygen-com/hyperframes","slug":"whisper-cpp-build-failed-ensure-cmake-and-a-c-com","errorCode":null,"errorMessage":"whisper-cpp build failed. Ensure cmake and a C compiler are installed.${detail}","messagePattern":"whisper-cpp build failed\\. Ensure cmake and a C compiler are installed\\.(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/whisper/manager.ts","lineNumber":137,"sourceCode":"    execFileSync(\"cmake\", [\"-B\", \"build\"], {\n      cwd: BUILD_DIR,\n      stdio: [\"pipe\", \"pipe\", \"pipe\"],\n      timeout: 120_000,\n    });\n    execFileSync(\"cmake\", [\"--build\", \"build\", \"--config\", \"Release\", \"-j\"], {\n      cwd: BUILD_DIR,\n      stdio: [\"pipe\", \"pipe\", \"pipe\"],\n      timeout: 300_000,\n    });\n  } catch (err: unknown) {\n    // Build failed — capture diagnostics, then clean up so next attempt starts fresh\n    let detail = \"\";\n    if (err && typeof err === \"object\" && \"stderr\" in err) {\n      const stderr = String(err.stderr).trim();\n      if (stderr) detail = `\\n${stderr.slice(-500)}`;\n    }\n    rmSync(BUILD_DIR, { recursive: true, force: true });\n    throw new Error(\n      `whisper-cpp build failed. Ensure cmake and a C compiler are installed.${detail}`,\n    );\n  }\n\n  const result = findBuiltBinary();\n  if (!result) throw new Error(\"Build completed but whisper-cli not found\");\n  return result;\n}\n\n// --- Public API -------------------------------------------------------------\n\nexport function findWhisper(): WhisperResult | undefined {\n  return findFromEnv() ?? findFromSystem() ?? findBuiltBinary();\n}\n\nexport function getInstallInstructions(): string {\n  if (platform() === \"darwin\") {\n    return \"brew install whisper-cpp\";","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/whisper/manager.ts#L119-L155","documentation":"Thrown when building whisper.cpp from source fails — the execFileSync call for the cmake/make build process threw an error. The catch block extracts the last 500 characters of stderr for the detail, deletes the build directory so the next attempt starts fresh, and throws with guidance to install cmake and a C compiler. This is one of the resolution strategies in findWhisper/ensureWhisper before giving up entirely.","triggerScenarios":"cmake or a C compiler (gcc/clang) is not installed or not on PATH; the cmake configure step fails (missing dependencies, wrong cmake version); the compilation step fails (out of memory, compiler error); the build times out after 300 seconds.","commonSituations":"Minimal CI containers without build-essential or cmake; macOS without Xcode Command Line Tools; a system with an incompatible compiler version; disk full during the build.","solutions":["Install cmake and a C compiler: on macOS run xcode-select --install; on Debian/Ubuntu run apt install cmake build-essential; on Fedora run dnf install cmake gcc-c++.","Check the stderr detail in the error message for the specific build failure.","On macOS, use Homebrew instead: brew install whisper-cpp (skips source build entirely).","Alternatively, install whisper-cpp manually and ensure it's on PATH or set the HYPERFRAMES_WHISPER env var."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"import { execFileSync } from \"node:child_process\";\n\nfunction hasBuildPrerequisites(): { cmake: boolean; compiler: boolean } {\n  const cmake = (() => { try { execFileSync(\"cmake\", [\"--version\"], { stdio: \"ignore\" }); return true; } catch { return false; } })();\n  const cc = (() => { try { execFileSync(\"cc\", [\"--version\"], { stdio: \"ignore\" }); return true; } catch { return false; } })();\n  return { cmake, compiler: cc };\n}","typeGuard":null,"tryCatchPattern":"import { isWhisperUnavailable } from \"./manager.js\";\n\ntry {\n  await ensureWhisper();\n} catch (err) {\n  if (isWhisperUnavailable(err)) {\n    // Build failed as part of the resolution chain — already fell through.\n    // Skip captions or guide the user.\n  }\n  // For build-specific errors, check stderr detail in err.message\n  if (err.message.includes(\"build failed\")) {\n    console.error(`Install cmake and a C compiler, then retry.`);\n  }\n}","preventionTips":["Install cmake and a C compiler before first use (build-essential on Linux, Xcode CLT on macOS).","On macOS, prefer Homebrew (brew install whisper-cpp) to skip source builds entirely.","Set HYPERFRAMES_WHISPER to a pre-built binary to avoid building from source."],"tags":["whisper","build","dependencies","native-compilation"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}