{"record":{"id":"3e920d965303c557","repo":"BigPizzaV3/CodexPlusPlus","slug":"macos-bundle-binary-is-unexpectedly-small","errorCode":null,"errorMessage":"macOS bundle binary is unexpectedly small: {}","messagePattern":"macOS bundle binary is unexpectedly small: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/install/macos.rs","lineNumber":153,"sourceCode":"    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)?;\n    use std::io::Read;\n    let read = file.read(&mut header)?;\n    if read == header.len() && header == *b\"#!\" {\n        anyhow::bail!(\n            \"macOS bundle binary points to a shell script: {}\",\n            path.display()\n        );\n    }\n    Ok(())\n}\n\n#[cfg(target_os = \"macos\")]","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/install/macos.rs#L135-L171","documentation":"Thrown by validate_binary_source (cfg macos) when the binary source file exists and is regular but is smaller than 1024 bytes — far below any plausible Mach-O executable, indicating a placeholder, truncated download, or text stub. The offending input is the undersized file at the given path; write_bundle refuses to ship it as the app executable.","triggerScenarios":"Thrown at crates/codex-plus-core/src/install/macos.rs:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["提供完整编译产物作为 binary_source","重新构建或重新下载二进制"],"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"}