{"record":{"id":"84ea889d90a1603c","repo":"slint-ui/slint","slug":"cargo-failed","errorCode":null,"errorMessage":"cargo {} failed","messagePattern":"cargo (.+?) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/license.rs","lineNumber":278,"sourceCode":"    name: String,\n    text: String,\n}\n\n/// Run `cargo fetch` (for all targets) so that `cargo metadata` can resolve the\n/// full dependency graph offline.\nfn fetch_dependencies(manifest_path: &Path) -> anyhow::Result<()> {\n    let manifest = manifest_path.to_str().context(\"Non-UTF-8 manifest path\")?;\n    run_cargo(&[\"fetch\", \"--manifest-path\", manifest])?;\n    Ok(())\n}\n\nfn run_cargo(args: &[&str]) -> anyhow::Result<()> {\n    let status = std::process::Command::new(std::env::var(\"CARGO\").as_deref().unwrap_or(\"cargo\"))\n        .args(args)\n        .status()\n        .with_context(|| format!(\"Failed to run cargo {}\", args.join(\" \")))?;\n    if !status.success() {\n        bail!(\"cargo {} failed\", args.join(\" \"));\n    }\n    Ok(())\n}\n\n/// Resolve the runtime dependency packages across all target platforms,\n/// restricted to the features enabled in the analyzed crate and honoring\n/// `IGNORE_DEV_DEPENDENCIES`.\n///\n/// `cargo metadata` is run without `--filter-platform`, so its resolve graph\n/// spans every target. Its graph keeps optional dependencies even when no\n/// active feature enables them, so the walk follows only the edges that the\n/// resolved feature set of each crate actually activates.\n///\n/// Only crates linked into the program are listed: the walk never crosses a\n/// `[build-dependencies]` edge or enters a proc-macro crate, since those are\n/// used only while building and are not distributed.\nfn resolve_packages(\n    manifest_path: &Path,","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/xtask/src/license.rs#L260-L296","documentation":"`run_cargo` in xtask executes a cargo subprocess and bails when it exits non-zero. The message includes the full argument list, so it reports which cargo invocation failed — it is a wrapper error around any cargo failure (build errors, bad args, toolchain problems).","triggerScenarios":"Any `cargo` command invoked by xtask (e.g. during license generation or metadata resolution) exiting with a non-zero status: syntax errors in Cargo.toml, unavailable network for registry access, wrong toolchain, or invalid arguments.","commonSituations":"CI runners without network access to crates.io; corrupted Cargo.lock; running xtask in an environment where `CARGO` env var points to a broken binary.","solutions":["Run the reported cargo command manually to see the underlying error output","Fix the underlying cargo failure (Cargo.toml syntax, network, toolchain) indicated by the cargo output","Ensure the CARGO environment variable points to a working cargo when overriding the default"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"cargo --version && cargo metadata --format-version 1 > /dev/null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify cargo works and the registry is reachable before running xtask","Inspect the args echoed in the error to reproduce the failing command manually","Keep Cargo.toml/Cargo.lock syntactically valid and committed"],"tags":["cargo","xtask","subprocess","ci"],"backgroundTag":"git-command-failed","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}