summaryrefslogtreecommitdiff
path: root/recipes/gst-plugins-rs.recipe
diff options
context:
space:
mode:
authorL. E. Segovia <amy@centricular.com>2023-12-03 12:05:00 -0300
committerL. E. Segovia <amy@centricular.com>2024-01-19 17:13:05 -0300
commitc8db3eef4096f5f16220b9401fef62013cd16e1f (patch)
tree7f4f50d6561d80e255a292e0d655b716af64b635 /recipes/gst-plugins-rs.recipe
parenta099b24187dbac88b47a165590a33d815e3c36c4 (diff)
rust: Disallow multicore and multiarch parallelism with low-end boxes
An attempt at fixing OOM errors with M1 Macbooks which have only 4 cores and 8GB RAM. A single rustc process for gst-plugins-rs is enough to exhaust the box for the duration of the build process. Closes #456 Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1317>
Diffstat (limited to 'recipes/gst-plugins-rs.recipe')
-rw-r--r--recipes/gst-plugins-rs.recipe8
1 files changed, 7 insertions, 1 deletions
diff --git a/recipes/gst-plugins-rs.recipe b/recipes/gst-plugins-rs.recipe
index c7a583b1..cf8b76f5 100644
--- a/recipes/gst-plugins-rs.recipe
+++ b/recipes/gst-plugins-rs.recipe
@@ -1,7 +1,7 @@
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
from custom import GStreamer
from cerbero.utils import messages as m
-from cerbero.utils import shell
+from cerbero.utils import shell, determine_num_cargo_jobs
from pathlib import Path
import re
import shutil
@@ -62,6 +62,12 @@ class Recipe(recipe.Recipe):
'webrtchttp',
]
+ # If the system has less than 8GB ram or less than 4 cores,
+ # block parallelism at both recipe and architectural level.
+ if determine_num_cargo_jobs() == 1:
+ allow_parallel_build = False
+ allow_universal_parallel_build = False
+
# Needed for openssl
use_system_libs = True
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'pango', 'cairo',