Skip to content

Define GLIBCXX_DEBUG in Debug builds with libstdc++#605

Open
nikobockerman wants to merge 1 commit into
mainfrom
use-glibc-debug
Open

Define GLIBCXX_DEBUG in Debug builds with libstdc++#605
nikobockerman wants to merge 1 commit into
mainfrom
use-glibc-debug

Conversation

@nikobockerman

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 3, 2026 08:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds libstdc++ debug-mode compilation support in CI by defining _GLIBCXX_DEBUG for Debug presets, improving runtime checking for STL usage in debug builds.

Changes:

  • Introduces a hidden preset (_ci-libstdc++-debug) that provides -D_GLIBCXX_DEBUG via an environment variable.
  • Updates Ubuntu libstdc++ Debug CI presets (clang+libstdc++ and gcc+libstdc++) to include that flag in CMAKE_CXX_FLAGS.

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

Comment thread .github/files/CMakeUserPresets.json
"name": "_ci-libstdc++-debug",
"hidden": true,
"environment": {
"PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG": "-D_GLIBCXX_DEBUG"
Copilot AI review requested due to automatic review settings July 25, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

.github/files/CMakeUserPresets.json:151

  • _ci-libstdc++-debug sets CMAKE_CXX_FLAGS to only -D_GLIBCXX_DEBUG. Because preset inheritance overwrites cache variables, any preset that inherits this after another preset that sets CMAKE_CXX_FLAGS will silently lose the other required flags (and the current debug presets must work around that by re-stating the full flag list). Prefer keeping this preset to only define the environment variable and let other presets incorporate it into their own CMAKE_CXX_FLAGS.
      "cacheVariables": {
        "CMAKE_CXX_FLAGS": "$env{PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG}"
      }

.github/files/CMakeUserPresets.json:85

  • This preset overrides CMAKE_CXX_FLAGS just to add -D_GLIBCXX_DEBUG, which duplicates the base GCC flags and can drift over time. Consider folding $env{PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG} into the shared GCC/libstdc++ preset’s CMAKE_CXX_FLAGS (or another shared preset) so this top-level preset doesn’t need to restate flags.
      "cacheVariables": {
        "CMAKE_CXX_FLAGS": "$env{PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG} $env{PRESET_CXX_FLAGS_GCC_CLANG}"
      }

Comment on lines +62 to +64
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG} $env{PRESET_CXX_FLAGS_GCC_CLANG} $env{PRESET_CXX_FLAGS_LIBSTDCPP_FOR_CLANG_COMMON} $env{PRESET_CXX_FLAGS_LIBSTDCPP_FOR_CLANG_UBUNTU}"
}
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.

2 participants