Skip to content

Commit a4cfb5c

Browse files
cmbolingclaude
andcommitted
docs(conan): default missing license to NOASSERTION
A Conan recipe with no `license` made license_of return None, which dump() wrote as `license: null`. fossa-deps requires a String for custom dependencies, so this failed with: Error in $['custom-dependencies'][N].license: parsing Text failed, expected String, but encountered Null Default a missing/empty license to the SPDX "NOASSERTION" marker so the generated fossa-deps.yml stays valid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b63dbd3 commit a4cfb5c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

docs/walkthroughs/make_fossa_deps_conan.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ def name_version_of(label: str) -> Tuple[str, str]:
114114
# are dual-licensed (consumer's choice).
115115
MULTI_LICENSE_JOINER = " AND "
116116

117+
# fossa-deps requires a license string for every custom dependency. When a Conan recipe
118+
# declares no license, fall back to the SPDX "NOASSERTION" marker so the file stays valid;
119+
# emitting a bare `license: null` triggers: expected String, but encountered Null.
120+
NO_LICENSE = "NOASSERTION"
121+
117122
def license_of(node: dict) -> Optional[str]:
118123
raw = node.get("license")
119124
if raw is None:
@@ -174,7 +179,7 @@ def mk_fossa_deps(graph):
174179
vendored_deps.append(FossaVendorDep(name, version, src_dir))
175180
else:
176181
logging.info(f"could not find source code in disk for: {label}, using this as vendored dependency for fossa-deps")
177-
custom_deps.append(FossaCustomDep(name, version, license, FossaCustomDepMetadata(homepage, description)))
182+
custom_deps.append(FossaCustomDep(name, version, license or NO_LICENSE, FossaCustomDepMetadata(homepage, description)))
178183

179184
fossa_dep_yml = FossaDep(vendored_deps, custom_deps)
180185
fossa_dep_yml.dump()

0 commit comments

Comments
 (0)