Skip to content

Commit 654a6d7

Browse files
committed
Fix Windows CI C1060 by reducing build parallelism
Windows CI was hitting C1060 "compiler is out of heap space" even after splitting test files to 1,200 lines. Root cause: GitHub's windows-latest runners have only 16GB RAM, and parallel cl.exe processes exhaust memory with template-heavy code. Solution (based on Microsoft docs + community solutions): 1. Add `-A x64` to ensure 64-bit toolset (32-bit has ~2-3GB limit) 2. Use `/m:4` to limit MSBuild to 4 worker processes 3. Use `/p:CL_MPCount=1` to disable cl.exe's internal /MP flag This reduces peak compiler memory usage while still maintaining reasonable build performance (~4x parallelism at MSBuild level). Refs: - https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1060 - appveyor/ci#742
1 parent a7a421c commit 654a6d7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
if: runner.os == 'Windows'
5252
run: >
5353
cmake -B build -S .
54-
-G "Visual Studio 17 2022"
54+
-G "Visual Studio 17 2022" -A x64
5555
-DFASTMCPP_BUILD_TESTS=ON
5656
-DFASTMCPP_BUILD_EXAMPLES=ON
5757
@@ -61,8 +61,9 @@ jobs:
6161

6262
- name: Build (Windows)
6363
if: runner.os == 'Windows'
64-
# Single-threaded build on Windows to avoid compiler heap space issues with large test files
65-
run: cmake --build build --config ${{ matrix.build_type }} --parallel 1
64+
# Reduce parallelism to avoid C1060 "compiler out of heap space" on GitHub's 16GB Windows runners
65+
# /m:4 limits MSBuild workers, /p:CL_MPCount=1 disables cl.exe's /MP flag
66+
run: cmake --build build --config ${{ matrix.build_type }} -- /m:4 /p:CL_MPCount=1
6667

6768
- name: Test
6869
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure

0 commit comments

Comments
 (0)