aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Horodniceanu <a.horodniceanu@proton.me>2024-09-23 21:22:29 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2024-10-02 23:15:07 +0300
commit3c2d04d702a765a9510ede80f517f5274dde5933 (patch)
tree40a020c00e621664a0f5ee20d2f2c8dd84a00431
parent9d0de83368c89ff7fc54ec95d5f15ec29e8e0f0e (diff)
downloadmeson-3c2d04d702a765a9510ede80f517f5274dde5933.zip
meson-3c2d04d702a765a9510ede80f517f5274dde5933.tar.gz
meson-3c2d04d702a765a9510ede80f517f5274dde5933.tar.bz2
ci/ciimage: Lower nofile ulimit on containers that test D
The D stdlib function std.process.spawnProcessPosix suffers from a bug that causes any program that calls it to OOM if the nofile ulimit is large. This doesn't affect CI currently but trying to run or build the containers locally will most likely crash when calling dub as docker defaults to something like 1073741816 for both the hard limit and soft limit. Lowering the soft limit is enough to make dub behave. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
-rwxr-xr-xci/ciimage/opensuse/install.sh3
-rwxr-xr-xci/ciimage/ubuntu-rolling/install.sh4
2 files changed, 7 insertions, 0 deletions
diff --git a/ci/ciimage/opensuse/install.sh b/ci/ciimage/opensuse/install.sh
index 7de18ec..fdfedcb 100755
--- a/ci/ciimage/opensuse/install.sh
+++ b/ci/ciimage/opensuse/install.sh
@@ -35,6 +35,9 @@ echo 'export PKG_CONFIG_PATH="/usr/lib64/mpi/gcc/openmpi3/lib64/pkgconfig:$PKG_C
curl -fsS https://dlang.org/install.sh | bash -s dmd | tee dmd_out.txt
cat dmd_out.txt | grep source | sed 's/^[^`]*`//g' | sed 's/`.*//g' >> /ci/env_vars.sh
chmod +x /ci/env_vars.sh
+# Lower ulimit before running dub, otherwise there's a very high chance it will OOM.
+# See: https://github.com/dlang/phobos/pull/9048 and https://github.com/dlang/phobos/pull/8990
+echo 'ulimit -n -S 10000' >> /ci/env_vars.sh
source /ci/env_vars.sh
diff --git a/ci/ciimage/ubuntu-rolling/install.sh b/ci/ciimage/ubuntu-rolling/install.sh
index 1706d83..2066944 100755
--- a/ci/ciimage/ubuntu-rolling/install.sh
+++ b/ci/ciimage/ubuntu-rolling/install.sh
@@ -44,6 +44,10 @@ eatmydata apt-get -y install --no-install-recommends wine-stable # Wine is spec
install_python_packages hotdoc
+# Lower ulimit before running dub, otherwise there's a very high chance it will OOM.
+# See: https://github.com/dlang/phobos/pull/9048 and https://github.com/dlang/phobos/pull/8990
+echo 'ulimit -n -S 10000' >> /ci/env_vars.sh
+ulimit -n -S 10000
# dub stuff
dub_fetch urld
dub build --deep urld --arch=x86_64 --compiler=gdc --build=debug