diff mbox series

[v2,1/2] sbom-cve-check-common: Fatalize command failure

Message ID 20260528165557.19677-1-niko.mauno@vaisala.com
State Accepted, archived
Commit c56fed2c293dc384003e088154bc88c2d8aec472
Headers show
Series [v2,1/2] sbom-cve-check-common: Fatalize command failure | expand

Commit Message

Niko Mauno May 28, 2026, 4:55 p.m. UTC
From: Niko Mauno <niko.mauno@vaisala.com>

Change the bb.error to bb.fatal in order to avoid marking the
'sbom_cve_check' task successful, even when it encounters an error,
like:

   sbom-cve-check: error: [Errno 2] No such file or directory: '/build/layers/openembedded-core/build/tmp/deploy/images/qemuarm/.spdx.json'

  -NOTE: Tasks Summary: Attempted 5946 tasks of which 5283 didn't need to be rerun and all succeeded.
  +NOTE: Tasks Summary: Attempted 5945 tasks of which 5944 didn't need to be rerun and 1 failed.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 meta/classes/sbom-cve-check-common.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes/sbom-cve-check-common.bbclass b/meta/classes/sbom-cve-check-common.bbclass
index 32c29a0ec2..1bd1af22b6 100644
--- a/meta/classes/sbom-cve-check-common.bbclass
+++ b/meta/classes/sbom-cve-check-common.bbclass
@@ -117,8 +117,7 @@  def run_sbom_cve_check(d, sbom_path, export_base_name, export_link_name=None):
         bb.note("Running: {}".format(" ".join(cmd_args)))
         bb.process.run(cmd_args, env=cmd_env)
     except bb.process.ExecutionError as e:
-        bb.error(f"sbom-cve-check failed: {e}")
-        return
+        bb.fatal(f"sbom-cve-check failed: {e}")
 
     show_warnings = bb.utils.to_boolean(d.getVar("SBOM_CVE_CHECK_SHOW_WARNINGS"))