From bc6771657fcb8f7042450567360333f18d980b99 Mon Sep 17 00:00:00 2001 From: Jens Maus Date: Sat, 23 Sep 2023 18:04:11 +0200 Subject: [PATCH] package/nodejs: fix parallel build Unless told otherwise, ninja will spawn as many jobs as there are CPU (plus 2). Nodejs is built with ninja, but it is a generic package, so there is no variable (like with cmake-package) that passes the proper number of parallel jobs as configured by the user. As a consequence, the nodejs build will use as many CPU as are available, possibly overcommitting the rsources the user expected to be used. Set the JOBS variableto limit that number. Signed-off-by: Jens Maus [yann.morin.1998@free.fr: reword commit log] Signed-off-by: Yann E. MORIN (cherry picked from commit 84c24ab1b5a7d38b481b37a759480ff2273b499d) Signed-off-by: Peter Korsgaard --- package/nodejs/nodejs.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk index fe629ada21..4e70bd71a3 100644 --- a/package/nodejs/nodejs.mk +++ b/package/nodejs/nodejs.mk @@ -46,14 +46,16 @@ HOST_NODEJS_MAKE_OPTS = \ CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \ LDFLAGS.host="$(HOST_LDFLAGS)" \ NO_LOAD=cctest.target.mk \ - PATH=$(@D)/bin:$(BR_PATH) + PATH=$(@D)/bin:$(BR_PATH) \ + JOBS=$(BR2_JLEVEL) NODEJS_MAKE_OPTS = \ $(TARGET_CONFIGURE_OPTS) \ NO_LOAD=cctest.target.mk \ PATH=$(@D)/bin:$(BR_PATH) \ LDFLAGS="$(NODEJS_LDFLAGS)" \ - LD="$(TARGET_CXX)" + LD="$(TARGET_CXX)" \ + JOBS=$(BR2_JLEVEL) # nodejs's build system uses python which can be a symlink to an unsupported # python version (e.g. python 3.10 with nodejs 14.18.1). We work around this by