{"record":{"id":"b7ff9752a641e21f","repo":"BigPizzaV3/CodexPlusPlus","slug":"macos-bundle-is-missing-its-binary-source","errorCode":null,"errorMessage":"macOS bundle is missing its binary source","messagePattern":"macOS bundle is missing its binary source","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/install/macos.rs","lineNumber":127,"sourceCode":"fn write_bundle(bundle: &MacosAppBundle) -> anyhow::Result<()> {\n    let contents = bundle.app_path.join(\"Contents\");\n    let macos = contents.join(\"MacOS\");\n    let resources = contents.join(\"Resources\");\n    fs::create_dir_all(&macos)?;\n    fs::create_dir_all(&resources)?;\n    fs::write(contents.join(\"Info.plist\"), &bundle.info_plist)?;\n    if let (Some(source), Some(target_name)) = (&bundle.binary_source, &bundle.binary_target_name) {\n        validate_binary_source(source)?;\n        let target = macos.join(target_name);\n        if source != &target {\n            fs::copy(source, &target)?;\n        }\n        validate_binary_source(&target)?;\n        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    })?;","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/install/macos.rs#L109-L145","documentation":"Thrown by write_bundle while assembling a macOS .app bundle when the bundle declares a binary_source (and binary_target_name) pair but the required binary source slot is inconsistent — i.e. the write_bundle fast path cannot proceed because the bundle is missing its binary source. The offending input is the MacosAppBundle's binary_source/binary_target_name pair; without a valid source binary the .app would be a shell without an executable.","triggerScenarios":"Thrown at crates/codex-plus-core/src/install/macos.rs:127 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["检查 bundle 配置确保 binary_source 与 binary_target_name 成对提供","确认源二进制路径存在且可读"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}