{"record":{"id":"a31fee902a77e1bb","repo":"Hmbown/CodeWhale","slug":"macos-builds-require-xcode-command-line-tools-to-package","errorCode":null,"errorMessage":"macOS builds require Xcode Command Line Tools to package Computer Use","messagePattern":"macOS builds require Xcode Command Line Tools to package Computer Use","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/tui/build.rs","lineNumber":64,"sourceCode":"            \"-mmacosx-version-min=13.0\",\n            \"-framework\",\n            \"Cocoa\",\n            \"-framework\",\n            \"ApplicationServices\",\n            \"-framework\",\n            \"ScreenCaptureKit\",\n            \"-framework\",\n            \"AVFoundation\",\n            \"-framework\",\n            \"CoreMedia\",\n            \"-framework\",\n            \"Vision\",\n        ])\n        .arg(&source)\n        .arg(\"-o\")\n        .arg(&output)\n        .output()\n        .expect(\"macOS builds require Xcode Command Line Tools to package Computer Use\");\n    assert!(\n        compiled.status.success(),\n        \"Computer Use helper compilation failed: {}\",\n        String::from_utf8_lossy(&compiled.stderr)\n    );\n    // Developer builds use ad-hoc signing; release builders can supply the\n    // same Developer ID as the app. No keychain lookup or credential copying.\n    let identity = std::env::var(\"CODEWHALE_CU_SIGN_IDENTITY\").unwrap_or_else(|_| \"-\".into());\n    let signed = std::process::Command::new(\"codesign\")\n        .args([\n            \"--force\",\n            if identity == \"-\" {\n                \"--timestamp=none\"\n            } else {\n                \"--timestamp\"\n            },\n            \"--options\",\n            \"runtime\",","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/build.rs#L46-L82","documentation":"This panic comes from crates/tui/build.rs:64 inside build_computer_use_helper. The build script shells out to the macOS toolchain (clang with Vision framework flags) to compile the Computer Use helper binary, and .expect() panics if the compiler process cannot be spawned. It exists so macOS packaging fails with a clear message instead of an obscure linker error later.","triggerScenarios":"Running cargo build/test for crates/tui on a macOS host where the `clang` invocation in build_computer_use_helper cannot be executed via std::process::Command::output() — i.e. no Xcode Command Line Tools installed or clang not on PATH.","commonSituations":"Fresh macOS machine or CI runner without `xcode-select --install`; Xcode CLT upgraded/removed by a system update; building inside a sandboxed container image that lacks the toolchain; PATH stripped of /usr/bin in the build environment.","solutions":["Install the toolchain: run `xcode-select --install` and accept the dialog.","Verify with `clang --version` and `xcode-select -p` that the tools are installed and active.","If multiple Xcode installs exist, point the host at one: `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer`.","Fix PATH in CI so /usr/bin (containing clang) is available to the build script.","On non-macOS hosts this build step should be skipped; confirm target OS detection in build.rs is correct rather than installing Xcode."],"exampleFix":"// before\n.output()\n.expect(\"macOS builds require Xcode Command Line Tools to package Computer Use\");\n// after\n// install tools first, e.g. in CI:\n// xcode-select --install || true\n.output()\n.expect(\"macOS builds require Xcode Command Line Tools to package Computer Use (run: xcode-select --install)\");","handlingStrategy":"validation","validationCode":"// in build.rs, before invoking clang\nif !Command::new(\"clang\").arg(\"--version\").output().map(|o| o.status.success()).unwrap_or(false) {\n    panic!(\"clang not found; install Xcode Command Line Tools: xcode-select --install\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add an xcode-select --install step to macOS CI images and dev setup docs.","Smoke-check `clang --version` and `codesign --version` in CI before cargo build.","Keep the Computer Use helper build step gated on target_os = \"macos\" so non-mac hosts never need clang.","Document the toolchain requirement in the build script's panic message and README."],"tags":["build-script","macos","toolchain","panic"],"backgroundTag":"command-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}