From a2ffdf4807040d102364925a5746482b547b8b1d Mon Sep 17 00:00:00 2001 From: "Ryan M. Richard" Date: Wed, 12 Aug 2026 09:20:46 -0500 Subject: [PATCH] Cap CMake Build parallelism to avoid OOM-cancelled runners Unbounded --parallel starts one compiler invocation per core; on heavily-templated C++ (e.g. sigma's TaylorModel headers) that can exceed a GitHub-hosted runner's RAM, OOM-killing the runner's own listener process. GitHub Actions then reports the job as cancelled (exit 143) instead of a normal build failure, which is what happened 3/3 times on Integrals#171's (ubuntu-latest, gcc-14) sigma job while every other matrix cell passed. Co-Authored-By: Claude Sonnet 5 --- .github/actions/cmake_build/action.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/actions/cmake_build/action.yml b/.github/actions/cmake_build/action.yml index 50ebe4d..84163fd 100644 --- a/.github/actions/cmake_build/action.yml +++ b/.github/actions/cmake_build/action.yml @@ -133,7 +133,26 @@ runs: - name: Build shell: bash - run: cmake --build build --parallel + # Unbounded `--parallel` (defaults to nproc) starts one gcc/clang + # invocation per core simultaneously; heavily-templated C++ (e.g. + # sigma's TaylorModel headers) makes each of those invocations + # memory-heavy enough that nproc concurrent compiles can exceed a + # GitHub-hosted runner's RAM. That OOM-kills the compiler *and* the + # runner's own listener process, which GitHub Actions then reports as + # the job being cancelled (exit 143 / "runner has received a shutdown + # signal") instead of a normal build failure -- confirmed via 3 + # consecutive reproductions of exactly this on test_enable_sigma's + # (ubuntu-latest, gcc-14) matrix cell, while every other cell + # (including the same sigma build on macos-14 and on + # ubuntu-latest/clang-18) passed. Halving nproc trades some build + # speed for headroom; revisit if it turns out insufficient. + run: | + nproc_count=$(getconf _NPROCESSORS_ONLN) + jobs=$(( nproc_count / 2 )) + if [ "$jobs" -lt 1 ]; then + jobs=1 + fi + cmake --build build --parallel "$jobs" - name: ccache Stats shell: bash