diff mbox series

[v2,15/18] spdx-common: Declare SPDX_FORCE_*_SCOPE override variables

Message ID 20260221051006.335141-16-stondo@gmail.com
State Under Review
Headers show
Series spdx30: SBOM enrichment, lifecycle scope, and documentation | expand

Commit Message

Stefano Tondo Feb. 21, 2026, 5:10 a.m. UTC
From: Stefano Tondo <stefano.tondo.ext@siemens.com>

Add bbclass variable declarations for SPDX_FORCE_BUILD_SCOPE,
SPDX_FORCE_TEST_SCOPE, and SPDX_FORCE_RUNTIME_SCOPE. These optional
variables allow recipes to override the automatic lifecycle scope
classification for dependency relationships.

The scope classification code in spdx30_tasks.py already handles these
variables gracefully when unset. These declarations provide discoverability
and documentation for users who need to correct edge cases in automatic
scope detection.

Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com>
---
 meta/classes/spdx-common.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes/spdx-common.bbclass b/meta/classes/spdx-common.bbclass
index 81c61e10dc..99f0704caf 100644
--- a/meta/classes/spdx-common.bbclass
+++ b/meta/classes/spdx-common.bbclass
@@ -52,6 +52,19 @@  SPDX_CONCLUDED_LICENSE[doc] = "The license concluded by manual or external \
     Example: SPDX_CONCLUDED_LICENSE = 'MIT & Apache-2.0' or \
     SPDX_CONCLUDED_LICENSE:${PN} = 'MIT & Apache-2.0'"
 
+# Lifecycle scope override variables for dependency classification
+SPDX_FORCE_BUILD_SCOPE ??= ""
+SPDX_FORCE_BUILD_SCOPE[doc] = "Space-separated list of recipe names to force \
+    into build scope, overriding automatic dependency classification."
+
+SPDX_FORCE_TEST_SCOPE ??= ""
+SPDX_FORCE_TEST_SCOPE[doc] = "Space-separated list of recipe names to force \
+    into test scope. By default, test dependencies are classified as build."
+
+SPDX_FORCE_RUNTIME_SCOPE ??= ""
+SPDX_FORCE_RUNTIME_SCOPE[doc] = "Space-separated list of recipe names to force \
+    into runtime scope, overriding automatic dependency classification."
+
 SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}"
 
 SPDX_FILES_INCLUDED ??= "all"