{"record":{"id":"0660491eb49ca70f","repo":"tauri-apps/tauri","slug":"error-message-e","errorCode":null,"errorMessage":"{error_message}: {e}","messagePattern":"\\{error_message\\}: \\{e\\}","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-macos-sign/src/lib.rs","lineNumber":362,"sourceCode":"  let decoded = base64::engine::general_purpose::STANDARD\n    .decode(&cleaned)\n    .map_err(Error::Base64Decode)?;\n\n  std::fs::write(out_path, &decoded).map_err(|error| Error::Fs {\n    context: \"failed to write decoded certificate\",\n    path: out_path.to_path_buf(),\n    error,\n  })?;\n\n  Ok(())\n}\n\nfn assert_command(\n  response: std::result::Result<std::process::ExitStatus, std::io::Error>,\n  error_message: &str,\n) -> std::io::Result<()> {\n  let status =\n    response.map_err(|e| std::io::Error::new(e.kind(), format!(\"{error_message}: {e}\")))?;\n  if !status.success() {\n    Err(std::io::Error::other(error_message))\n  } else {\n    Ok(())\n  }\n}\n","sourceCodeStart":344,"sourceCodeEnd":369,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-macos-sign/src/lib.rs#L344-L369","documentation":"tauri-macos-sign shells out to macOS tools (codesign, security, hdiutil, xcrun). assert_command takes the spawn Result of the command; this formatted branch ('{error_message}: {e}') fires only when the process could not be launched at all — the io::Error kind and OS message are preserved alongside the caller's prefix. A tool that starts but exits non-zero takes the other branch (bare io::Error::other(error_message)), so this variant specifically means launch failure.","triggerScenarios":"Signing or notarizing when the tool binary cannot start: Xcode Command Line Tools not installed, xcode-select pointing at a broken/missing developer directory, PATH stripped in CI or launchd environments, or an exec-format/architecture mismatch.","commonSituations":"Fresh macOS CI runners without Command Line Tools; headless build agents; scripts run from GUI apps with minimal PATH; a macOS/Xcode upgrade that invalidated the active developer directory.","solutions":["Install Command Line Tools: `xcode-select --install` (or full Xcode)","Verify the tool resolves: `xcrun --find codesign` and `codesign -h`","Reset a stale developer directory: `sudo xcode-select -r`","In CI, ensure PATH includes /usr/bin and set DEVELOPER_DIR explicitly to the CLT path"],"exampleFix":"# before: signing fails with 'failed to run codesign: ...'\nxcode-select -p   # missing or broken path\n# after:\nxcode-select --install\nxcode-select -p   # /Library/Developer/CommandLineTools","handlingStrategy":"validation","validationCode":"// preflight: ensure the macOS tool exists before signing\nfn require_tool(name: &str) -> std::io::Result<()> {\n    let ok = std::process::Command::new(\"xcrun\")\n        .arg(\"--find\")\n        .arg(name)\n        .output()\n        .map(|o| o.status.success())\n        .unwrap_or(false);\n    if ok {\n        Ok(())\n    } else {\n        Err(std::io::Error::new(\n            std::io::ErrorKind::NotFound,\n            format!(\"{name} not found; run `xcode-select --install`\"),\n        ))\n    }\n}","typeGuard":null,"tryCatchPattern":"match sign_app(&app_path) {\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        eprintln!(\"signing tool unavailable — install Xcode Command Line Tools: {e}\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e.into()),\n    Ok(()) => {}\n}","preventionTips":["Bake `xcode-select --install` / DEVELOPER_DIR setup into CI images","Add a preflight `xcrun --find codesign` step before any signing job","Distinguish launch failures (NotFound) from non-zero exits when reporting errors"],"tags":["macos","codesign","signing","process-spawn","environment"],"backgroundTag":"command-not-found","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","contentChangedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}