Morganamilo/paru · error

{}: {}

Error message

{}: {}

What it means

command_output runs an external command (pacman, makepkg) and, if the child process exits non-zero, bails with '{command}: {stderr}'. It is the generic wrapper that converts failed subprocess invocations into this error, including the command description and trimmed stderr text.

Solutions

  1. Read the stderr text in the error message — it is the child tool's own diagnostic
  2. Fix the underlying pacman/makepkg issue (install missing deps, resolve file conflicts, refresh keys/mirrors)
  3. Rerun the operation manually (makepkg -s, pacman -Syu) to reproduce and debug interactively
  4. Ensure sufficient disk space and correct config flags (chroot, mflags) before retrying
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check that the tools exist and are runnable
which::which("pacman")?;
which::which("makepkg")?;

Try / catch

match run() {
    Err(e) => {
        // message is '{command}: {stderr}' — surface stderr to the user
        eprintln!("subprocess failed: {e}");
        std::process::exit(1);
    }
    Ok(v) => v,
}

Prevention

When it happens

Trigger: Any invocation routed through command_output — pacman_output or makepkg_output_dest — where the spawned process writes to stderr and exits with a failing status (e.g. pacman reporting a conflicting package, makepkg reporting a build failure).

Common situations: makepkg failing due to missing makedepends or a broken PKGBUILD; pacman refusing an operation (conflicts, unavailable mirrors, signature errors); disk full during build; wrong flags passed to the underlying tool.

Related errors


AI-assisted analysis of Morganamilo/paru@9ac3578807 (2026-09-12). Data as JSON: /api/errors/75abb9c6f69875c4. Report an issue: GitHub.

Appendix: source

Thrown at src/exec.rs:122

    Ok(())
}

pub fn command_output(cmd: &mut Command) -> Result<Output> {
    debug!("running command: {:?}", cmd);
    let term = &*CAUGHT_SIGNAL;

    DEFAULT_SIGNALS.store(false, Ordering::Relaxed);

    let ret = cmd.output().with_context(|| command_err(cmd));

    DEFAULT_SIGNALS.store(true, Ordering::Relaxed);
    let ret = match term.swap(0, Ordering::Relaxed) {
        0 => ret?,
        n => std::process::exit(128 + n as i32),
    };

    if !ret.status.success() {
        bail!(
            "{}: {}",
            command_err(cmd),
            String::from_utf8_lossy(&ret.stderr).trim()
        );
    }

    Ok(ret)
}

pub fn spawn(cmd: &mut Command) -> Result<Child> {
    debug!("running command: {:?}", cmd);
    cmd.spawn().with_context(|| command_err(cmd))
}

pub fn wait(cmd: &Command, child: &mut Child) -> Result<Status> {
    let status = child
        .wait()
        .map(|s| Status(s.code().unwrap_or(1)))

View on GitHub (pinned to 9ac3578807)