* [Buildroot] [git commit] package/nodejs: fix parallel build further
@ 2023-09-28 20:05 Yann E. MORIN
2023-09-30 10:35 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2023-09-28 20:05 UTC (permalink / raw)
To: buildroot
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
commit: https://git.buildroot.net/buildroot/commit/?id=d574e2a4f440903a0e32de6deb8275b1f385da2e
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
Commit 84c24ab1b5a7 (package/nodejs: fix parallel build) made use of
BR2_JLEVEL to set the number of jobs nodejs should use instead of using
the number of CPUs (+2).
However, BR2_JLEVEL can be set to 0 by the user, to let Buildroot detect
the number of CPUs (+1), and stores it in PARALLEL_JOBS, and leaves
BR2_JLEVEL untouched, so 0.
Thus, we can end up spawning a build by passing -j0 to ninja, which it
interprets as "no -limit yolo" and does not limit the number oj jobs it
spawns, which usually ends up in an OOM somewhere...
Fix this by using PARALLEL_JOBS.
Reported-by: Cédric & Co
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
package/nodejs/nodejs.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 4e70bd71a3..b8e57e567d 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -47,7 +47,7 @@ HOST_NODEJS_MAKE_OPTS = \
LDFLAGS.host="$(HOST_LDFLAGS)" \
NO_LOAD=cctest.target.mk \
PATH=$(@D)/bin:$(BR_PATH) \
- JOBS=$(BR2_JLEVEL)
+ JOBS=$(PARALLEL_JOBS)
NODEJS_MAKE_OPTS = \
$(TARGET_CONFIGURE_OPTS) \
@@ -55,7 +55,7 @@ NODEJS_MAKE_OPTS = \
PATH=$(@D)/bin:$(BR_PATH) \
LDFLAGS="$(NODEJS_LDFLAGS)" \
LD="$(TARGET_CXX)" \
- JOBS=$(BR2_JLEVEL)
+ JOBS=$(PARALLEL_JOBS)
# 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
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [git commit] package/nodejs: fix parallel build further
2023-09-28 20:05 [Buildroot] [git commit] package/nodejs: fix parallel build further Yann E. MORIN
@ 2023-09-30 10:35 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2023-09-30 10:35 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> commit: https://git.buildroot.net/buildroot/commit/?id=d574e2a4f440903a0e32de6deb8275b1f385da2e
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
> Commit 84c24ab1b5a7 (package/nodejs: fix parallel build) made use of
> BR2_JLEVEL to set the number of jobs nodejs should use instead of using
> the number of CPUs (+2).
> However, BR2_JLEVEL can be set to 0 by the user, to let Buildroot detect
> the number of CPUs (+1), and stores it in PARALLEL_JOBS, and leaves
> BR2_JLEVEL untouched, so 0.
> Thus, we can end up spawning a build by passing -j0 to ninja, which it
> interprets as "no -limit yolo" and does not limit the number oj jobs it
> spawns, which usually ends up in an OOM somewhere...
> Fix this by using PARALLEL_JOBS.
> Reported-by: Cédric & Co
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Committed to 2023.02.x and 2023.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-30 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28 20:05 [Buildroot] [git commit] package/nodejs: fix parallel build further Yann E. MORIN
2023-09-30 10:35 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox