{"record":{"id":"c37f7f8d9b10e3fa","repo":"BigPizzaV3/CodexPlusPlus","slug":"macos-bundle-binary-is-unavailable-at-error","errorCode":null,"errorMessage":"macOS bundle binary is unavailable at {}: {error}","messagePattern":"macOS bundle binary is unavailable at (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/install/macos.rs","lineNumber":141,"sourceCode":"        let mut permissions = fs::metadata(&target)?.permissions();\n        permissions.set_mode(0o755);\n        fs::set_permissions(target, permissions)?;\n    } else {\n        anyhow::bail!(\"macOS bundle is missing its binary source\");\n    }\n    let executable = macos.join(executable_name_from_plist(&bundle.info_plist));\n    fs::write(&executable, &bundle.launch_script)?;\n    let mut permissions = fs::metadata(&executable)?.permissions();\n    permissions.set_mode(0o755);\n    fs::set_permissions(executable, permissions)?;\n    copy_icon(&resources)?;\n    Ok(())\n}\n\n#[cfg(target_os = \"macos\")]\nfn validate_binary_source(path: &Path) -> anyhow::Result<()> {\n    let metadata = fs::metadata(path).map_err(|error| {\n        anyhow::anyhow!(\n            \"macOS bundle binary is unavailable at {}: {error}\",\n            path.display()\n        )\n    })?;\n    if !metadata.is_file() {\n        anyhow::bail!(\n            \"macOS bundle binary is not a regular file: {}\",\n            path.display()\n        );\n    }\n    if metadata.len() < 1024 {\n        anyhow::bail!(\n            \"macOS bundle binary is unexpectedly small: {}\",\n            path.display()\n        );\n    }\n    let mut header = [0_u8; 2];\n    let mut file = fs::File::open(path)?;","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/install/macos.rs#L123-L159","documentation":"On macOS, validate_binary_source (macOS-only) checks via fs::metadata that the binary to be written into the bundle exists and is a regular file before copying it. If metadata cannot be read, the path with the OS error is reported; this particular message is the metadata-read failure arm.","triggerScenarios":"write_bundle is called with a source binary path that does not exist or is inaccessible (broken symlink, wrong build output path, path on an unmounted volume).","commonSituations":"Packaging script points at a stale target/release path; cargo build skipped or failed so the binary was never produced; network volume unmounted; permission issue on the build output.","solutions":["Build the binary first (cargo build --release) and confirm the path exists","Correct the configured binary source path to the actual build output","Check file permissions on the path and its parent directories","Verify the volume containing the binary is mounted"],"exampleFix":"// before\nvalidate_binary_source(Path::new(\"target/debug/app\")) // not built\n// after\ncargo build --release\nvalidate_binary_source(Path::new(\"target/release/app\"))","handlingStrategy":"validation","validationCode":"use std::path::Path;\nfn binary_ready(path: &Path) -> bool {\n    path.is_file() // exists and is a regular file\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = write_bundle(&src, &dst) {\n    if e.to_string().starts_with(\"macOS bundle binary is unavailable\") {\n        eprintln!(\"Rebuild the binary or fix the source path: {e}\");\n    }\n}","preventionTips":["Run cargo build --release before packaging and assert the output path exists","Keep bundle scripts pointing at target/release, not stale paths","Verify volumes holding build artifacts are mounted before packaging"],"tags":["macos","packaging","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}