From a3d3049825875d0d8c197cf4a36d230ff5d49371 Mon Sep 17 00:00:00 2001 From: Michael Heller <21163552+mdheller@users.noreply.github.com> Date: Thu, 23 Jul 2026 09:22:33 -0400 Subject: [PATCH] windows: add 14G swap + MOZ_BUILD_JOBS=3 on CI to survive rustc OOM (exit 143) -j$(nproc)=4 still OOM-killed the neqo/mls-platform-api/icu rustc cluster on 16GB runners (each of those is multi-GB; exit 143 = cargo propagating an OOM-killed child). Add a 14G swapfile to absorb the spikes and expose MOZ_BUILD_JOBS so CI can run -j3 while the 32-core sovereign builder keeps its nproc default. --- .github/workflows/nightly-windows.yml | 12 ++++++++++++ scripts/build-windows-cross.sh | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly-windows.yml b/.github/workflows/nightly-windows.yml index e473c37..6c13c91 100644 --- a/.github/workflows/nightly-windows.yml +++ b/.github/workflows/nightly-windows.yml @@ -30,6 +30,8 @@ jobs: VERSION: 150.0.1 RELEASE: 1 PROFILE: human-secure + # 16GB runners OOM the neqo/mls/icu rustc cluster at higher parallelism. + MOZ_BUILD_JOBS: 3 steps: - name: Checkout @@ -41,6 +43,16 @@ jobs: /opt/hostedtoolcache/CodeQL /usr/local/share/boost "$AGENT_TOOLSDIRECTORY" || true df -h / + - name: Add swap (absorb rustc memory spikes on 16GB runners) + run: | + sudo swapoff -a || true + sudo rm -f /mnt/swapfile /swapfile || true + sudo fallocate -l 14G /mnt/swapfile + sudo chmod 600 /mnt/swapfile + sudo mkswap /mnt/swapfile + sudo swapon /mnt/swapfile + free -h + - name: Cache Mozilla toolchain (clang-cl, cbindgen) uses: actions/cache@v4 with: diff --git a/scripts/build-windows-cross.sh b/scripts/build-windows-cross.sh index 5df56ea..f23b283 100755 --- a/scripts/build-windows-cross.sh +++ b/scripts/build-windows-cross.sh @@ -157,10 +157,11 @@ export PATH="$MOZ_CLANG_BIN:$HOME/.cargo/bin:$PATH" ulimit -n "$NOFILE" ./mach configure -# Cap parallelism at the core count: mach's memory heuristic over-parallelizes -# on 16GB CI runners and a burst of rustc processes gets the job SIGTERM'd -# (exit 143, ~10min in). -j$(nproc) is also correct on the big sovereign builder. -./mach build -j"$(nproc)" +# Cap parallelism: mach's memory heuristic over-parallelizes on 16GB CI runners +# and a burst of multi-GB rustc processes (neqo/mls/icu) gets OOM-killed (exit +# 143, ~10min in). MOZ_BUILD_JOBS lets CI dial it down (the workflow sets a low +# value + adds swap); defaults to nproc for the 32-core sovereign builder. +./mach build -j"${MOZ_BUILD_JOBS:-$(nproc)}" ./mach package log "artifacts"