Define GLIBCXX_DEBUG in Debug builds with libstdc++#605
Open
nikobockerman wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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_DEBUGvia 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.
| "name": "_ci-libstdc++-debug", | ||
| "hidden": true, | ||
| "environment": { | ||
| "PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG": "-D_GLIBCXX_DEBUG" |
nikobockerman
force-pushed
the
use-glibc-debug
branch
from
July 25, 2026 21:44
2119eea to
6d87d79
Compare
Contributor
There was a problem hiding this comment.
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++-debugsetsCMAKE_CXX_FLAGSto only-D_GLIBCXX_DEBUG. Because preset inheritance overwrites cache variables, any preset that inherits this after another preset that setsCMAKE_CXX_FLAGSwill 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 ownCMAKE_CXX_FLAGS.
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{PRESET_CXX_FLAGS_LIBSTDCPP_DEBUG}"
}
.github/files/CMakeUserPresets.json:85
- This preset overrides
CMAKE_CXX_FLAGSjust 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’sCMAKE_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}" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.