BigPizzaV3/CodexPlusPlus · error

macOS bundle binary is unexpectedly small: {}

Error message

macOS bundle binary is unexpectedly small: {}

What it means

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.

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 f2074595a2)

Solutions

  1. 提供完整编译产物作为 binary_source
  2. 重新构建或重新下载二进制
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/install/macos.rs:153 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/3e920d965303c557. Report an issue: GitHub.