{"record":{"id":"dbd2bd9f99bc9f56","repo":"rust-lang/rust","slug":"collecting-licensing-information-with-reuse-failed","errorCode":null,"errorMessage":"collecting licensing information with REUSE failed","messagePattern":"collecting licensing information with REUSE failed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/collect-license-metadata/src/reuse.rs","lineNumber":46,"sourceCode":"\n    Ok(result)\n}\n\nfn obtain_spdx_document(reuse_exe: &Path) -> Result<String, Error> {\n    let output = Command::new(reuse_exe)\n        .args(&[\"--include-submodules\", \"spdx\", \"--add-license-concluded\", \"--creator-person=bors\"])\n        .stdout(Stdio::piped())\n        .spawn()?\n        .wait_with_output()?;\n\n    if !output.status.success() {\n        eprintln!();\n        eprintln!(\"Note that Rust requires some REUSE features that might not be present in the\");\n        eprintln!(\"release you're using. Make sure your REUSE release includes these PRs:\");\n        eprintln!();\n        eprintln!(\" - https://github.com/fsfe/reuse-tool/pull/623\");\n        eprintln!();\n        anyhow::bail!(\"collecting licensing information with REUSE failed\");\n    }\n\n    Ok(String::from_utf8(output.stdout)?)\n}\n","sourceCodeStart":28,"sourceCodeEnd":51,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/collect-license-metadata/src/reuse.rs#L28-L51","documentation":"Thrown by obtain_spdx_document in collect-license-metadata when the external `reuse` command (invoked with --include-submodules spdx --add-license-concluded --creator-person=bors) exits with a non-zero status. The tool first prints guidance noting that Rust requires specific unreleased REUSE features (linking fsfe/reuse-tool PR #623), then bails.","triggerScenarios":"The REUSE binary is too old and lacks required features; REUSE is not installed or not on PATH; REUSE exits non-zero because of a malformed/incomplete licensing state in the repo (e.g. a file with no license info and no default).","commonSituations":"Using a distro-packaged REUSE that predates the needed PRs; REUSE_EXE points at the wrong binary; a newly added file lacks REUSE-compliant headers; REUSE version mismatch between local and CI environments.","solutions":["Upgrade REUSE to a version that includes fsfe/reuse-tool PR #623 (and any other linked PRs).","Run the REUSE command manually to see its stderr: `reuse --include-submodules spdx --add-license-concluded --creator-person=bors`.","Ensure REUSE_EXE points at a valid, executable REUSE binary.","Add REUSE-compliant license/copyright headers to any offending files REUSE complains about."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Verify REUSE is installed and recent enough before collecting.\nlet output = Command::new(&reuse_exe).arg(\"--version\").output()?;\nif !output.status.success() {\n    eprintln!(\"REUSE_EXE '{:?}' not runnable; install REUSE >= supported version\", reuse_exe);\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = crate::reuse::collect(&reuse_exe, &mut interner) {\n    if e.to_string().contains(\"REUSE failed\") {\n        eprintln!(\"{e:#}\");\n        eprintln!(\"Upgrade REUSE to include fsfe/reuse-tool PR #623\");\n    }\n    return Err(e);\n}","preventionTips":["Pin a REUSE version known to work with Rust's collect-license-metadata.","Keep REUSE_EXE pointing at a current, executable binary.","Add REUSE-compliant headers to new files proactively."],"tags":["collect-license-metadata","reuse","licensing","external-tool"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}