Hmbown/CodeWhale · error · anyhow::Error

self-update is not supported on HarmonyOS/OpenHarmony yet

Error message

self-update is not supported on HarmonyOS/OpenHarmony yet

What it means

On HarmonyOS/OpenHarmony builds (cfg(target_env = "ohos")) the `codewhale update` command has no self-update implementation and returns this error instead of attempting in-place binary replacement. It is a hard platform limitation of the shipped build.

Source

Thrown at crates/cli/src/lib.rs:1987

            let mut cmd = Cli::command();
            generate(shell, &mut cmd, "codewhale", &mut io::stdout());
            Ok(())
        }
        Some(Commands::Metrics(args)) => run_metrics_command(args),
        Some(Commands::Update(args)) => {
            let resolved_runtime =
                resolve_runtime_for_diagnostic_dispatch(&store, &runtime_overrides);
            let session = start_cli_telemetry(
                &resolved_runtime,
                Some(store.path().to_path_buf()),
                Surface::Cli,
            );
            #[cfg(not(target_env = "ohos"))]
            let outcome = update::run_update(args.beta, args.check, args.proxy);
            #[cfg(target_env = "ohos")]
            let outcome = {
                let _ = args;
                Err(anyhow!(
                    "self-update is not supported on HarmonyOS/OpenHarmony yet"
                ))
            };
            finish_cli_telemetry(session, &outcome);
            outcome
        }
        None => {
            let resolved_runtime = resolve_runtime_for_dispatch(&mut store, &runtime_overrides);
            let forwarded = root_tui_passthrough(&cli)?;
            run_tui_in_process(&cli, &resolved_runtime, forwarded)
        }
    }
}

fn root_tui_passthrough(cli: &Cli) -> Result<Vec<String>> {
    let mut forwarded = Vec::new();
    if cli.continue_session {
        forwarded.push("--continue".to_string());

View on GitHub (pinned to 8880682c63)

Solutions

  1. Update through the channel that installed the binary: package manager, hdc push of a rebuilt binary, or re-flashing the app bundle
  2. Remove update steps from ohos deployment scripts and use --check-only flows elsewhere
  3. Track upstream releases for ohos self-update support before re-enabling it
Defensive patterns

Strategy: validation

Validate before calling

# In deployment scripts, feature-detect before calling update:
 if codewhale --version | grep -q ohos; then
   echo "self-update unavailable on OHOS; redeploy via package channel"
 else
   codewhale update
 fi

Prevention

When it happens

Trigger: Executing `codewhale update [--beta|--check]` on any ohos-targeted build of the CLI.

Common situations: Cross-compiled deployments on HarmonyOS devices; CI images or automation built for ohos that still call update as on other platforms.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/754a52d3574d241e. Report an issue: GitHub.