{"record":{"id":"6a05a0b0c3a3126f","repo":"rust-lang/rust","slug":"file-missing-licenseconcluded","errorCode":null,"errorMessage":"file missing LicenseConcluded","messagePattern":"file missing LicenseConcluded","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/collect-license-metadata/src/spdx/mod.rs","lineNumber":95,"sourceCode":"            text.push_str(rest);\n            return Ok(text);\n        }\n        text.push('\\n');\n        text.push_str(line);\n    }\n\n    anyhow::bail!(\"unexpected end of input inside <text> block\")\n}\n\nfn build_file_entry(\n    name: String,\n    concluded_license: Option<String>,\n    copyright_text: Option<String>,\n) -> Result<SpdxFileEntry, Error> {\n    Ok(SpdxFileEntry {\n        name,\n        concluded_license: concluded_license\n            .ok_or_else(|| anyhow::anyhow!(\"file missing LicenseConcluded\"))?,\n        copyright_text: copyright_text\n            .ok_or_else(|| anyhow::anyhow!(\"file missing FileCopyrightText\"))?,\n    })\n}\n\n#[cfg(test)]\nmod tests;\n","sourceCodeStart":77,"sourceCodeEnd":103,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/collect-license-metadata/src/spdx/mod.rs#L77-L103","documentation":"Thrown by build_file_entry when a file section in the SPDX document has a FileName but no LicenseConcluded tag was recorded before the next FileName (or end of document). collect-license-metadata requires a concluded license for every file; the REUSE invocation is told --add-license-concluded precisely so this field is populated, so its absence indicates a problem.","triggerScenarios":"REUSE was not run with --add-license-concluded (or the flag had no effect); a file has indeterminable licensing so REUSE omitted LicenseConcluded; an older REUSE version that does not support concluded-license inference.","commonSituations":"REUSE version too old to infer concluded licenses; a file with conflicting/ambiguous license info that REUSE cannot resolve; the SPDX document was generated by a different tool that omits LicenseConcluded.","solutions":["Ensure REUSE is invoked with --add-license-concluded (as obtain_spdx_document does) and that the version supports it.","Add explicit REUSE license annotations to the offending file so REUSE can conclude a license.","Upgrade REUSE to a current release.","Inspect the SPDX section for the file to see what tags ARE present."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Count LicenseConcluded tags vs FileName tags to detect missing licenses up front.\nlet files = input.lines().filter(|l| l.starts_with(\"FileName:\")).count();\nlet licenses = input.lines().filter(|l| l.starts_with(\"LicenseConcluded:\")).count();\nif licenses < files {\n    eprintln!(\"{files} files but only {licenses} LicenseConcluded tags; some files lack a concluded license\");\n}","typeGuard":null,"tryCatchPattern":"match crate::spdx::parse_tag_value(raw) {\n    Err(e) if e.to_string().contains(\"missing LicenseConcluded\") => {\n        eprintln!(\"{e:#}. Ensure REUSE runs with --add-license-concluded and annotations are complete.\");\n        return Err(e);\n    }\n    other => other?,\n}","preventionTips":["Always pass --add-license-concluded to REUSE.","Add explicit license annotations to files REUSE cannot resolve.","Use a REUSE version that supports concluded-license inference."],"tags":["collect-license-metadata","spdx","licensing","parsing"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}