DioxusLabs/dioxus · error · anyhow::Error

` ` failed with exit code

Error message

`{description}` failed with exit code: {}

What it means

A macOS bundling helper command (signing, stapling, or keychain setup) exited with a non-zero status. The generic run_command wrapper reports the human-readable description and exit code instead of the raw spawn result.

Solutions

  1. The named notarization step failed. Read its exit code and output, then fix the reported error.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/cli/src/bundler/macos.rs:907 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23). Data as JSON: /api/errors/66c413aa0732ccf7. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/bundler/macos.rs:907

    tracing::info!("Stapling notarization ticket...");
    let mut staple_cmd = Command::new("xcrun");
    staple_cmd.args(["stapler", "staple"]).arg(staple_path);
    run_command(&mut staple_cmd, "xcrun stapler staple").await?;

    tracing::info!("Notarization complete for {}", staple_path.display());
    Ok(())
}

/// Helper to run a command and return a nice error on failure.
async fn run_command(cmd: &mut Command, description: &str) -> Result<()> {
    tracing::debug!("Running: {:?}", cmd);
    let status = cmd
        .status()
        .await
        .with_context(|| format!("Failed to execute `{description}`"))?;

    if !status.success() {
        bail!("`{description}` failed with exit code: {}", status);
    }
    Ok(())
}

/// Decode base64 (standard or URL-safe).
async fn base64_decode(input: &str) -> Result<Vec<u8>> {
    let mut child = Command::new("base64")
        .args(["--decode"])
        .stdin(Stdio::piped())
        .stdout(Stdio::piped())
        .stderr(Stdio::piped())
        .spawn()
        .context("Failed to decode base64 certificate")?;

    if let Some(mut stdin) = child.stdin.take() {
        stdin
            .write_all(input.as_bytes())
            .await

View on GitHub (pinned to 24f6a829df)