Skip to content

Commit

Permalink
ci/ciimage: Lower nofile ulimit on containers that test D
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
the-horo authored and jpakkane committed Oct 2, 2024
1 parent 9d0de83 commit 3c2d04d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ci/ciimage/opensuse/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions ci/ciimage/ubuntu-rolling/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c2d04d

Please sign in to comment.