From 2a011c6464d7eef2bdfef98c67509b4cc5ebed0a Mon Sep 17 00:00:00 2001 From: Hornfisk <30924992+Hornfisk@users.noreply.github.com> Date: Sat, 25 Jul 2026 12:51:20 +0200 Subject: [PATCH] ci: bound Windows build parallelism to fix intermittent OOM The Build step set JOBS="-j" as its default and only overrode it with an explicit cap for Linux (-j 2) and macOS (-j 3), leaving the windows-2022 matrix leg with a bare, unbounded -j. A bare -j/--parallel means make/cmake spawn one compiler or linker per ready translation unit; with JUCE's large TUs, plus LTO staying enabled specifically on Windows in the Configure step, that exhausts the runner's RAM and the job gets killed with SIGTERM (exit 143, "Terminated", no compiler error above it). It's intermittent - the same commit can pass one run and fail the next depending on scheduling. Pin Windows to -j 2 (matching Linux's conservative cap, since Windows keeps LTO on and each link is heavier) and change the fallback default from bare -j to -j 2 so any future unlisted matrix OS is safe too. --- .github/workflows/build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 816dd06..faffab2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,11 +55,22 @@ jobs: - name: Build shell: bash run: | - JOBS="-j" + # A bare -j (no number) is unbounded parallelism: make/cmake spawn + # one compiler/linker per ready translation unit. With JUCE's large + # TUs this exhausts the runner's RAM and the job is killed with + # SIGTERM (exit 143, "Terminated", no compiler error above it) - + # intermittent, same commit can pass one run and fail the next. + # Default below is a safe fallback for any OS not explicitly listed. + JOBS="-j 2" if [ "$RUNNER_OS" = "Linux" ]; then JOBS="-j 2"; fi # macos-14 has 3 cores; a bare -j lets make spawn an unbounded number of # heavy (universal = 2x) compiles at once and thrash into swap. Pin it. if [ "$RUNNER_OS" = "macOS" ]; then JOBS="-j 3"; fi + # windows-2022: LTO stays ON here (see Configure step above), which + # makes each link heavier than the LTO-OFF Linux/macOS builds; this + # leg previously fell through to the unbounded default above and + # was the one actually at risk of the OOM/SIGTERM described above. + if [ "$RUNNER_OS" = "Windows" ]; then JOBS="-j 2"; fi cmake --build build --config Release $JOBS - name: Test