Skip to content

Reduce C++ CodeQL build scope#1448

Open
bmehta001 wants to merge 3 commits into
microsoft:mainfrom
bmehta001:bhamehta/codeql-slim-cpp-build
Open

Reduce C++ CodeQL build scope#1448
bmehta001 wants to merge 3 commits into
microsoft:mainfrom
bmehta001:bhamehta/codeql-slim-cpp-build

Conversation

@bmehta001
Copy link
Copy Markdown
Contributor

Reduce the C++ CodeQL extraction size so the standard Windows runner is less likely to hit query-analysis OOM.

Changes

  • replace the C++ CodeQL build-all.bat invocation with a single representative x64 Release MSBuild call
  • keep the native desktop and UWP library targets plus their SQLite/zlib dependencies covered
  • stop building duplicate Debug/Release, Win32/x64, MD/MT, test, sample, and C#-oriented targets during C++ CodeQL extraction

Notes

This intentionally does not cap CodeQL analysis threads. The first-line fix is reducing the database size; thread capping can still be added later if the smaller extraction is not enough.

Build a single representative x64 Release native configuration instead of the full Windows matrix so CodeQL extracts a smaller database and avoids standard-runner memory exhaustion.

Files changed:

- .github/workflows/codeql-analysis.yml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmehta001 bmehta001 requested a review from a team as a code owner May 25, 2026 17:07
@bmehta001 bmehta001 requested a review from Copilot May 25, 2026 23:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the Windows CodeQL workflow to reduce the amount of C++ code built during CodeQL extraction, aiming to lower the generated CodeQL database size and reduce the risk of query-analysis OOM on the standard Windows runner.

Changes:

  • Replaces build-all.bat with a single representative x64 Release MSBuild invocation via tools\RunMsBuild.bat.
  • Limits the build targets to the core native desktop + UWP libraries and their sqlite / zlib dependencies.
  • Adds lightweight version generation and a shallow submodule initialization step as part of the C++ CodeQL build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bmehta001 bmehta001 self-assigned this May 26, 2026
Comment thread .github/workflows/codeql-analysis.yml Outdated
bmehta001 and others added 2 commits May 27, 2026 01:51
Keep the reduced CodeQL C++ target list in a dedicated batch file instead of embedding it directly in the workflow, as requested in review.

Files changed:

- .github/workflows/codeql-analysis.yml

- build-codeql-cpp.bat

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

3 participants