BigPizzaV3/CodexPlusPlus · error · anyhow::Error

当前平台暂不支持安装 Codex++ 入口

Error message

当前平台暂不支持安装 Codex++ 入口

What it means

platform_install's cfg-gated fallback bails when none of the supported platforms (windows, macOS) match at compile time. Codex++ entrypoint installation (app bundles / shortcuts) is only implemented for those targets, so installing on Linux/other platforms is explicitly unsupported.

Solutions

  1. Run the installer on Windows or macOS
  2. Add the missing platform arm (e.g. .desktop entries) if Linux support is required — that is a code change, not config
  3. If you only need the relay/config side, skip entrypoint installation and use the config-generation APIs directly
Defensive patterns

Strategy: try-catch

Validate before calling

#[cfg(any(windows, target_os = "macos"))]
// safe to call install_entrypoints here
if !(cfg!(windows) || cfg!(target_os = "macos")) {
    eprintln!("entrypoint install is unsupported on this platform; skipping");
}

Try / catch

match install_entrypoints(&options) {
    Ok(res) => println!("installed: {res:?}"),
    Err(e) if e.to_string().contains("暂不支持") => eprintln!("unsupported platform, skipped"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling install_entrypoints -> platform_install on a build compiled for a non-Windows, non-macOS target (e.g. Linux).

Common situations: Running the installer CLI on Linux; CI jobs targeting linux containers; contributors testing install flows on unsupported platforms.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/81d99658577fb51c. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/install/mod.rs:197

        "user-dirs-desktop"
    }
}

fn platform_install(options: &InstallOptions) -> anyhow::Result<()> {
    #[cfg(windows)]
    {
        windows::install_shortcuts(options)
    }

    #[cfg(target_os = "macos")]
    {
        macos::install_app_bundles(options)
    }

    #[cfg(not(any(windows, target_os = "macos")))]
    {
        let _ = options;
        anyhow::bail!("当前平台暂不支持安装 Codex++ 入口")
    }
}

fn platform_uninstall(options: &InstallOptions) -> anyhow::Result<()> {
    #[cfg(windows)]
    {
        windows::uninstall_shortcuts(options)
    }

    #[cfg(target_os = "macos")]
    {
        macos::uninstall_app_bundles(options)
    }

    #[cfg(not(any(windows, target_os = "macos")))]
    {
        let _ = options;
        anyhow::bail!("当前平台暂不支持卸载 Codex++ 入口")

View on GitHub (pinned to b1ed92e5e4)