BigPizzaV3/CodexPlusPlus · error · anyhow::Error

当前平台暂不支持卸载 Codex++ 入口

Error message

当前平台暂不支持卸载 Codex++ 入口

What it means

platform_uninstall's cfg-gated fallback bails on any target that is not Windows or macOS. Entrypoint uninstallation (shortcuts/app bundles) simply has no implementation for other platforms, so it fails fast with this Chinese-language message.

Solutions

  1. Run the uninstall on Windows or macOS where the entries were created
  2. On unsupported platforms, manually remove any entrypoint artifacts you created
  3. Implement a platform arm (cfg for the new target) if support is needed
  4. Skip entrypoint uninstall if no entries were ever installed on that platform
Defensive patterns

Strategy: try-catch

Validate before calling

if !(cfg!(windows) || cfg!(target_os = "macos")) {
    return; // nothing to uninstall on this platform
}

Try / catch

match uninstall_entrypoints(&options) {
    Ok(_) => println!("uninstalled"),
    Err(e) if e.to_string().contains("暂不支持") => eprintln!("no entrypoints on this platform"),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling uninstall_entrypoints -> platform_uninstall on a non-Windows/non-macOS build.

Common situations: Attempting cleanup of installs from a Linux host or container; scripted uninstall steps run on the wrong platform in CI.

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

Appendix: source

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

        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++ 入口")
    }
}

fn action_result(result: anyhow::Result<()>, success_message: &str) -> InstallActionResult {
    let state = inspect_entrypoints();
    match result {
        Ok(()) => InstallActionResult {
            status: "ok".to_string(),
            message: success_message.to_string(),
            silent_shortcut: state.silent_shortcut,
            management_shortcut: state.management_shortcut,
        },
        Err(error) => InstallActionResult {
            status: "failed".to_string(),
            message: error.to_string(),
            silent_shortcut: state.silent_shortcut,
            management_shortcut: state.management_shortcut,
        },

View on GitHub (pinned to b1ed92e5e4)