{"record":{"id":"75abb9c6f69875c4","repo":"Morganamilo/paru","slug":"exec","errorCode":null,"errorMessage":"{}: {}","messagePattern":"\\{\\}: \\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/exec.rs","lineNumber":122,"sourceCode":"    Ok(())\n}\n\npub fn command_output(cmd: &mut Command) -> Result<Output> {\n    debug!(\"running command: {:?}\", cmd);\n    let term = &*CAUGHT_SIGNAL;\n\n    DEFAULT_SIGNALS.store(false, Ordering::Relaxed);\n\n    let ret = cmd.output().with_context(|| command_err(cmd));\n\n    DEFAULT_SIGNALS.store(true, Ordering::Relaxed);\n    let ret = match term.swap(0, Ordering::Relaxed) {\n        0 => ret?,\n        n => std::process::exit(128 + n as i32),\n    };\n\n    if !ret.status.success() {\n        bail!(\n            \"{}: {}\",\n            command_err(cmd),\n            String::from_utf8_lossy(&ret.stderr).trim()\n        );\n    }\n\n    Ok(ret)\n}\n\npub fn spawn(cmd: &mut Command) -> Result<Child> {\n    debug!(\"running command: {:?}\", cmd);\n    cmd.spawn().with_context(|| command_err(cmd))\n}\n\npub fn wait(cmd: &Command, child: &mut Child) -> Result<Status> {\n    let status = child\n        .wait()\n        .map(|s| Status(s.code().unwrap_or(1)))","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/exec.rs#L104-L140","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Read the stderr text in the error message — it is the child tool's own diagnostic","Fix the underlying pacman/makepkg issue (install missing deps, resolve file conflicts, refresh keys/mirrors)","Rerun the operation manually (makepkg -s, pacman -Syu) to reproduce and debug interactively","Ensure sufficient disk space and correct config flags (chroot, mflags) before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check that the tools exist and are runnable\nwhich::which(\"pacman\")?;\nwhich::which(\"makepkg\")?;","typeGuard":null,"tryCatchPattern":"match run() {\n    Err(e) => {\n        // message is '{command}: {stderr}' — surface stderr to the user\n        eprintln!(\"subprocess failed: {e}\");\n        std::process::exit(1);\n    }\n    Ok(v) => v,\n}","preventionTips":["Read the stderr portion of the message — it contains the child tool's real diagnostic","Keep pacman/makepkg and the Arch keyring up to date","Run builds with sufficient disk space and correct makepkg flags","Reproduce failing commands manually for full output"],"tags":["subprocess","pacman","makepkg","command-failed"],"backgroundTag":"command-not-found","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}