BigPizzaV3/CodexPlusPlus · error · anyhow::Error
macOS bundle binary is unexpectedly small
Error message
macOS bundle binary is unexpectedly small: {} What it means
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.
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
Defensive patterns
Strategy: validation
Validate before calling
let meta = std::fs::metadata(&path)?;
if meta.len() < 1024 {
return Err(format!("binary too small ({} bytes): {}", meta.len(), path.display()));
} Prevention
- 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
When it happens
Trigger: write_bundle -> validate_binary_source on macOS when metadata.len() < 1024 for the source binary.
Common situations: 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.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- macOS bundle binary is not a regular file
- macOS bundle binary points to a shell script
- 当前平台暂不支持安装 Codex++ 入口
- 当前平台暂不支持卸载 Codex++ 入口
- 打开 DMG 失败:
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/3e920d965303c557.
Report an issue: GitHub.
Appendix: source
Thrown at crates/codex-plus-core/src/install/macos.rs:153
Ok(())
}
#[cfg(target_os = "macos")]
fn validate_binary_source(path: &Path) -> anyhow::Result<()> {
let metadata = fs::metadata(path).map_err(|error| {
anyhow::anyhow!(
"macOS bundle binary is unavailable at {}: {error}",
path.display()
)
})?;
if !metadata.is_file() {
anyhow::bail!(
"macOS bundle binary is not a regular file: {}",
path.display()
);
}
if metadata.len() < 1024 {
anyhow::bail!(
"macOS bundle binary is unexpectedly small: {}",
path.display()
);
}
let mut header = [0_u8; 2];
let mut file = fs::File::open(path)?;
use std::io::Read;
let read = file.read(&mut header)?;
if read == header.len() && header == *b"#!" {
anyhow::bail!(
"macOS bundle binary points to a shell script: {}",
path.display()
);
}
Ok(())
}
#[cfg(target_os = "macos")]View on GitHub (pinned to b1ed92e5e4)