BigPizzaV3/CodexPlusPlus · error

macOS bundle binary is not a regular file: {}

Error message

macOS bundle binary is not a regular file: {}

What it means

Thrown by validate_binary_source (cfg macos) when fs::metadata succeeds for the bundle binary but reports it is not a regular file (e.g. a directory, socket, or symlink target of unusual kind). The offending input is the path in question; write_bundle refuses to copy non-regular entries into Contents/MacOS.

Source

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

    let executable = macos.join(executable_name_from_plist(&bundle.info_plist));
    fs::write(&executable, &bundle.launch_script)?;
    let mut permissions = fs::metadata(&executable)?.permissions();
    permissions.set_mode(0o755);
    fs::set_permissions(executable, permissions)?;
    copy_icon(&resources)?;
    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()

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:147 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/b6f9759c15a7bc37. Report an issue: GitHub.