summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammad Farzan2021-06-20 03:30:20 +0430
committerMohammad Farzan2021-06-20 03:31:01 +0430
commit3f8ada5c7a21b2c2996ec3bcb63677086d8a0bbd (patch)
tree042ebda187dc54ebc9cd9e4f385e648990c37257
parentd030e876e9c1644dba26de6065225749348a7c6d (diff)
downloadaur-3f8ada5c7a21b2c2996ec3bcb63677086d8a0bbd.tar.gz
Disable parallel build if RAM is low
-rw-r--r--PKGBUILD9
1 files changed, 8 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9ff52b5974ce..57848368cada 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -50,7 +50,14 @@ prepare() {
}
build() {
- colcon build --merge-install
+ # Disable parallel build if RAM is low
+ if [[ $(free | grep -Po "Mem:\s+\K\d+") < 16000000 ]]; then
+ printf "\nRAM is smaller than 16 GB. Parallel build will be disabled for stability.\n\n"
+ export COLCON_EXTRA_ARGS="${COLCON_EXTRA_ARGS} --executor sequential"
+ fi
+
+ # Build
+ colcon build --merge-install ${COLCON_EXTRA_ARGS}
}
package() {