Skip to content

Re-enable Windows CI unit tests with memory optimizations#7419

Draft
Claude wants to merge 3 commits intomasterfrom
claude/enable-windows-ci-unit-tests
Draft

Re-enable Windows CI unit tests with memory optimizations#7419
Claude wants to merge 3 commits intomasterfrom
claude/enable-windows-ci-unit-tests

Conversation

@Claude
Copy link
Contributor

@Claude Claude AI commented Mar 20, 2026

Windows CI was disabled in #6930 due to MSVC running out of heap space (C1060: compiler is out of heap space) when building unit tests. This was caused by excessive parallel compilation processes consuming available memory on the CI runner.

Changes

  • CMakeLists.txt: Add /MP2 flag for MSVC to limit parallel compilation to 2 processes per invocation
  • Windows CI workflow:
    • Add --parallel 1 to cmake build commands to enforce sequential project builds
    • Add -A x64 flag to explicitly use 64-bit toolchain
    • Re-enable test building and execution

Approach

Two-level memory control:

  1. Compiler level (/MP2): Limits MSVC to 2 parallel translation units per compilation
  2. Build level (--parallel 1): Forces sequential target builds across the project

This reduces peak memory usage while maintaining some parallelism within individual compilation steps.

Original prompt

This section details on the original issue you should resolve

<issue_title>Windows CI job goes out of memory when building tests</issue_title>
<issue_description>We had to disable running unit tests on Windows in this PR. MSVC goes out of memory when trying to build tests:

2024-06-08T09:06:17.5884670Z D:\a\osrm-backend\osrm-backend\unit_tests\library\route.cpp(128,49): error C1060: compiler is out of heap space [D:\a\osrm-backend\osrm-backend\build\unit_tests\library-tests.vcxproj]

It seems it started happening after yet another update of CI base image.</issue_description>

<agent_instructions>Create a PR that re enables the unit test build on windows. Reduce parallel compilation — lower /MP degree (e.g. /MP2 instead of /MP) so fewer cl.exe processes compete for RAM simultaneously. Or define non parallel build in yaml:

  • name: Build
    run: cmake --build build --parallel 1

Verify we are using the 64 bit toolchain.

</agent_instructions>

Comments on the Issue (you are @claude[agent] in this section)

- Add /MP2 flag to MSVC compiler to limit parallel compilation
- Use --parallel 1 for cmake build to reduce memory pressure
- Add explicit -A x64 flag to ensure 64-bit toolchain is used
- Re-enable test building and execution in Windows CI workflow

Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Project-OSRM/osrm-backend/sessions/56738ea6-f252-48af-931a-34dd004d9204
@Claude Claude AI changed the title [WIP] Re-enable unit test build on Windows CI Re-enable Windows CI unit tests with memory optimizations Mar 20, 2026
@Claude Claude AI requested a review from DennisOSRM March 20, 2026 21:21
This limits parallelisation even further
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows CI job goes out of memory when building tests

2 participants