BigPizzaV3/CodexPlusPlus · error

macOS bundle binary points to a shell script: {}

Error message

macOS bundle binary points to a shell script: {}

What it means

Thrown by validate_binary_source (cfg macos) when the first two bytes of the binary source are the shebang sequence '#!'. A real Mach-O executable never starts with '#!'; this catches launch scripts or wrapper shell files mistakenly configured as the bundle binary. The offending input is the file at the given path whose header was sniffed.

Source

Thrown at crates/codex-plus-core/src/install/macos.rs:163

    })?;
    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")]
fn copy_icon(resources: &Path) -> anyhow::Result<()> {
    let source = std::env::current_exe()
        .ok()
        .and_then(|path| path.parent().map(Path::to_path_buf))
        .map(|path| path.join("codex-plus-plus.png"));
    if let Some(source) = source.filter(|path| path.exists()) {
        fs::copy(source, resources.join("codex-plus-plus.png"))?;
    }
    Ok(())
}

View on GitHub (pinned to f2074595a2)

Solutions

  1. 用真实编译产物替换脚本文件
  2. 检查构建流程是否误把启动脚本当二进制
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/install/macos.rs:163 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/442c50b2f8a4545f. Report an issue: GitHub.