{"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":"anyhow::Error","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/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/install/macos.rs#L135-L171","documentation":"validate_binary_source rejects the bundle binary when its size is under 1024 bytes. A real Rust executable is always far larger, so a tiny file indicates truncation, a stub, a placeholder, or a failed download that must not be copied into the .app bundle.","triggerScenarios":"write_bundle -> validate_binary_source on macOS when metadata.len() < 1024 for the source binary.","commonSituations":"Interrupted download or truncated artifact from CI; a placeholder text file committed where the binary belongs; LFS pointer files not materialized; disk-full writes producing partial binaries.","solutions":["Re-download or rebuild the binary and verify its size matches the expected artifact","Check `ls -l` / checksums against the release artifact to confirm integrity","If using Git LFS, run `git lfs pull` so the real binary replaces the pointer file","Free disk space and redo the packaging step if the artifact was truncated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let meta = std::fs::metadata(&path)?;\nif meta.len() < 1024 {\n    return Err(format!(\"binary too small ({} bytes): {}\", meta.len(), path.display()));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify artifact size/checksum against the release manifest before installing","Ensure downloads complete (check content-length) before handing paths to the installer","Watch for Git LFS pointer files in CI checkouts — run `git lfs pull`","Confirm the build step actually produced the binary, not a stub"],"tags":["macos","install","artifact-validation"],"backgroundTag":"file-size-limit-exceeded","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"}