]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sbom-cve-check-common: Fatalize command failure
authorNiko Mauno <niko.mauno@vaisala.com>
Tue, 26 May 2026 05:59:59 +0000 (05:59 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 May 2026 13:22:31 +0000 (14:22 +0100)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes/sbom-cve-check-common.bbclass

index 32c29a0ec2c3d54dea4ba41f235001f7f18711b3..1bd1af22b6cbe55f993ffedf9b8a7694863b7778 100644 (file)
@@ -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"))