rust-lang/rust · error · anyhow::Error
collecting licensing information with REUSE failed
Error message
collecting licensing information with REUSE failed
What it means
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.
Source
Thrown at src/tools/collect-license-metadata/src/reuse.rs:46
Ok(result)
}
fn obtain_spdx_document(reuse_exe: &Path) -> Result<String, Error> {
let output = Command::new(reuse_exe)
.args(&["--include-submodules", "spdx", "--add-license-concluded", "--creator-person=bors"])
.stdout(Stdio::piped())
.spawn()?
.wait_with_output()?;
if !output.status.success() {
eprintln!();
eprintln!("Note that Rust requires some REUSE features that might not be present in the");
eprintln!("release you're using. Make sure your REUSE release includes these PRs:");
eprintln!();
eprintln!(" - https://github.com/fsfe/reuse-tool/pull/623");
eprintln!();
anyhow::bail!("collecting licensing information with REUSE failed");
}
Ok(String::from_utf8(output.stdout)?)
}
View on GitHub (pinned to 7088e4b63a)
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.
Example fix
null
Defensive patterns
Strategy: validation
Validate before calling
// Verify REUSE is installed and recent enough before collecting.
let output = Command::new(&reuse_exe).arg("--version").output()?;
if !output.status.success() {
eprintln!("REUSE_EXE '{:?}' not runnable; install REUSE >= supported version", reuse_exe);
std::process::exit(1);
} Try / catch
if let Err(e) = crate::reuse::collect(&reuse_exe, &mut interner) {
if e.to_string().contains("REUSE failed") {
eprintln!("{e:#}");
eprintln!("Upgrade REUSE to include fsfe/reuse-tool PR #623");
}
return Err(e);
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- The existing {} file doesn't match what REUSE reports.
- unexpected end of input inside <text> block
- file missing LicenseConcluded
- file missing FileCopyrightText
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/dbd2bd9f99bc9f56.
Report an issue: GitHub.