Skip to content

Commit 39fea01

Browse files
benhillisBen HillisCopilot
authored
cgmanifest: attach explicit license to llvm-project entry (#48)
ClearlyDefined doesn't have license data for our pinned llvm-project commit, which produced a `Missing legal information` alert in CG. Attach the SPDX license string directly to the registration to short-circuit the lookup. Diff is 3 lines in `cgmanifest.json` and 7 lines in `gen-cgmanifest.py`. Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ac2c3a3 commit 39fea01

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

cgmanifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
"repositoryUrl": "https://github.com/llvm/llvm-project",
116116
"commitHash": "6009708b4367171ccdbf4b5905cb6a803753fe18"
117117
}
118-
}
118+
},
119+
"license": "Apache-2.0 WITH LLVM-exception"
119120
},
120121
{
121122
"component": {

pkg/Tools/gen-cgmanifest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@
1919
for m in re.finditer(r"^\s*ADD\s+(.+)$", text, re.M):
2020
rest = m.group(1)
2121
if g := re.search(r"(https?://\S+?)\.git#([0-9a-f]{40})\b", rest):
22-
regs.append({"component": {"type": "git", "git": {
23-
"repositoryUrl": g.group(1), "commitHash": g.group(2)}}})
22+
reg = {"component": {"type": "git", "git": {
23+
"repositoryUrl": g.group(1), "commitHash": g.group(2)}}}
24+
# ClearlyDefined doesn't have license data for our pinned llvm-project
25+
# commit, so attach it explicitly to avoid CG "Missing legal information".
26+
if g.group(1).endswith("/llvm/llvm-project"):
27+
reg["license"] = "Apache-2.0 WITH LLVM-exception"
28+
regs.append(reg)
2429
elif (c := re.search(r"--checksum=sha256:([0-9a-f]{64})", rest)) and \
2530
(u := re.search(r"https?://\S+", rest)):
2631
fname = u.group(0).rsplit("/", 1)[-1].split("?")[0]

0 commit comments

Comments
 (0)