[OE-core][PATCH v7 08/12] spdx: Remove fatal errors for missing providers

Joshua Watt
2026-03-18T13:47:10Z

When creating images and SDKs, do not error on missing providers. This
allows recipes to use the `nospdx` inherit to prevent SPDX from being
generated, but not result in an error when assembling the final image.

Note that runtime packages generation already ignored missing
providers, so this is changing image and SDK generation to match

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes/create-spdx-2.2.bbclass | 3 ++-
meta/lib/oe/spdx30_tasks.py | 8 +-------
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index 3288cdf75a..aa39208eae 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -858,7 +858,8 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages, spdx
if packages:
for name in sorted(packages.keys()):
if name not in providers:
- bb.fatal("Unable to find SPDX provider for '%s'" % name)
+ bb.note("Unable to find SPDX provider for '%s'" % name)
+ continue

pkg_name, pkg_hashfn = providers[name]

diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index 5b651900c4..c4af191974 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -1178,11 +1178,10 @@ def collect_build_package_inputs(d, objset, build, packages, files_by_hash=None)
providers = oe.spdx_common.collect_package_providers(d)

build_deps = set()
- missing_providers = set()

for name in sorted(packages.keys()):
if name not in providers:
- missing_providers.add(name)
+ bb.note(f"Unable to find SPDX provider for '{name}'")
continue

pkg_name, pkg_hashfn = providers[name]
@@ -1201,11 +1200,6 @@ def collect_build_package_inputs(d, objset, build, packages, files_by_hash=None)
for h, f in pkg_objset.by_sha256_hash.items():
files_by_hash.setdefault(h, set()).update(f)

- if missing_providers:
- bb.fatal(
- f"Unable to find SPDX provider(s) for: {', '.join(sorted(missing_providers))}"
- )
-
if build_deps:
objset.new_scoped_relationship(
[build],
--
2.53.0