diff mbox series

[meta-security,v2] scap-security-guide: disable ptest by default

Message ID 20250418131203.838267-1-yi.zhao@windriver.com
State New
Headers show
Series [meta-security,v2] scap-security-guide: disable ptest by default | expand

Commit Message

Yi Zhao April 18, 2025, 1:12 p.m. UTC
Enabling ptest will significantly increase build time. Additionally,
since the ptest distro_feature is enabled by default in poky distro,
build time can be very long, which is annoying.

On my build server:
Enable ptest:
$ time build scap-security-guide
real    266m41.257s
user    1m16.895s
sys     0m1.553s

Disable ptest:
$ time build scap-security-guide
real    1m29.228s
user    0m4.604s
sys     0m0.175s

Add a switch SSG_PTEST_ENABLED and set it to 0 to disable ptest by
default.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 .../scap-security-guide/scap-security-guide_0.1.76.bb         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/recipes-compliance/scap-security-guide/scap-security-guide_0.1.76.bb b/recipes-compliance/scap-security-guide/scap-security-guide_0.1.76.bb
index 73bd576..c91a5f9 100644
--- a/recipes-compliance/scap-security-guide/scap-security-guide_0.1.76.bb
+++ b/recipes-compliance/scap-security-guide/scap-security-guide_0.1.76.bb
@@ -18,7 +18,9 @@  DEPENDS = "openscap-native python3-pyyaml-native python3-jinja2-native libxml2-n
 S = "${UNPACKDIR}/git"
 B = "${S}/build"
 
-inherit cmake pkgconfig python3native python3targetconfig ptest
+SSG_PTEST_ENABLED ?= "0"
+
+inherit cmake pkgconfig python3native python3targetconfig ${@bb.utils.contains('SSG_PTEST_ENABLED', '1', 'ptest', '', d)}
 
 STAGING_OSCAP_BUILDDIR = "${TMPDIR}/work-shared/openscap/oscap-build-artifacts"
 export OSCAP_CPE_PATH="${STAGING_OSCAP_BUILDDIR}${datadir_native}/openscap/cpe"