Dynamic "make -j" parameter
This obviously interferes with Bazel's own scheduler, but these are
our only compute-intensive compilation tasks, anyway.
Fixes T522
Test Plan:
{F16451}
(fun fact: that EPYC 7401P wasn't faster than the 3900X)
Bug: T522
X-Origin-Diff: phab/D236
GitOrigin-RevId: 8735ece9eea6ed2cd38fda8823a674d0298b6dbc
diff --git a/core/build/linux_kernel/BUILD b/core/build/linux_kernel/BUILD
index e130142..e1f9c9b 100644
--- a/core/build/linux_kernel/BUILD
+++ b/core/build/linux_kernel/BUILD
@@ -20,7 +20,7 @@
cp $(locations @//core/build/utils) $$DIR/.bin/
cp $(location initramfs.list) $$DIR/initramfs.list
- (cd $$DIR && make -j 16) >/dev/null
+ (cd $$DIR && make -j $$(nproc)) >/dev/null
cp $$DIR/arch/x86/boot/bzImage $(RULEDIR)
""",
diff --git a/core/build/utils/BUILD b/core/build/utils/BUILD
index 216ffff..d49359a 100644
--- a/core/build/utils/BUILD
+++ b/core/build/utils/BUILD
@@ -39,7 +39,7 @@
(
cd external/musl
./configure --prefix=$$MUSL --syslibdir=$$MUSL/lib
- make -j 8 install
+ make -j $$(nproc) install
) > /dev/null
echo "Installing Linux kernel headers..."
@@ -63,7 +63,7 @@
--disable-makeinstall-chown \
--disable-makeinstall-setuid \
--with-bashcompletiondir=$$MUSL/usr/share/bash-completion
- make -j8 libuuid.la libblkid.la
+ make -j $$(nproc) libuuid.la libblkid.la
echo "Installing util_linux..."
cp -v .libs/* $$MUSL/lib/
mkdir -p $$MUSL/include/{uuid,blkid}