]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
ptest.bbclass: Honor PARALLEL_MAKE, PARALLEL_MAKEINST
authorniko.mauno@vaisala.com <niko.mauno@vaisala.com>
Wed, 22 Jun 2022 19:16:13 +0000 (22:16 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 Jun 2022 23:00:24 +0000 (00:00 +0100)
Since oe_runmake wrapper doesn't by default involve PARALLEL_MAKE
outside do_compile() nor PARALLEL_MAKEINST outside do_install(),
enable parallellized make by default when oe_runmake is invoked from
do_compile_ptest() or do_install_ptest() by declaring wrapper task
specific EXTRA_OEMAKE overrides in fashion similar to do_compile and
do_install overrides in meta/conf/bitbake.conf.

Parallel make can still be disabled by resetting bbclass specific
PTEST_PARALLEL_MAKE and PTEST_PARALLEL_MAKEINST variables in recipe
e.g. if a race issue needs to be avoided without modifying source code.

Tested by issuing following command sequence on a 32-core build host:

  $ bitbake -c clean util-linux && bitbake --skip-setscene -c compile util-linux && time bitbake --skip-setscene -c compile_ptest_base util-linux

and found that before this change the result was

  real 0m34.684s
  user 0m0.753s
  sys 0m0.131s

and after this change

  real 0m9.868s
  user 0m0.749s
  sys 0m0.150s

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
meta/classes/ptest.bbclass

index 1ec23c0923d40710e3ec3866097962d23c406022..c162f5d93424358e7c7bd63d884528025aca6853 100644 (file)
@@ -5,6 +5,10 @@ This package contains a test directory ${PTEST_PATH} for package test purposes."
 PTEST_PATH ?= "${libdir}/${BPN}/ptest"
 PTEST_BUILD_HOST_FILES ?= "Makefile"
 PTEST_BUILD_HOST_PATTERN ?= ""
+PTEST_PARALLEL_MAKE ?= "${PARALLEL_MAKE}"
+PTEST_PARALLEL_MAKEINST ?= "${PARALLEL_MAKEINST}"
+EXTRA_OEMAKE:prepend:task-compile-ptest-base = "${PTEST_PARALLEL_MAKE} "
+EXTRA_OEMAKE:prepend:task-install-ptest-base = "${PTEST_PARALLEL_MAKEINST} "
 
 FILES:${PN}-ptest += "${PTEST_PATH}"
 SECTION:${PN}-ptest = "devel"