-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflows/build.yml: Use debug std C++ library on Ubuntu #1247
workflows/build.yml: Use debug std C++ library on Ubuntu #1247
Conversation
Protect from regressions due to use of undefined or implementation-specific behavior when using `std::` containers and smart pointers. This only has effect on platforms with the GNU standard C++ library. Refer to https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html.
0972a2f
to
1b506b4
Compare
should prove that #1080 is not an issue |
@@ -37,6 +37,7 @@ jobs: | |||
${{format(matrix.generator != 'Default Generator' && '-G "{0}"' || '', matrix.generator)}} | |||
CMAKE_INSTALL_PREFIX: "${{ github.workspace }}/install-prefix" | |||
CMAKE_BUILD_TYPE: Debug | |||
CMAKE_CXX_FLAGS_DEBUG: ${{ matrix.googletest == 'build' && '-g -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC' || '-g' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you put the googletest == build clause here? Does the system googletest fail with these flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, 'system' failed to build, just 'build' worked.
I didn't dig deeper, but it's a common effect in the debug mode of the GNU standard C++ library that it can only be mixed with non-debug binaries when those do not exchange data with the debug-generated code in e.g. ˋstd::ˋ containers or smart pointers. I thus assumed that the system-provided googletest (which is obviously non-debug) doesn't mix with the debug structures, by design. So I excluded these variants from being built in the debug mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sounds good. Can you add a comment explaining this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just added an entry to the README. (did it during work time, so posting with my work account)
Protect from regressions due to use of undefined or
implementation-specific behavior when using
std::
containers and smartpointers.
This only has effect on platforms with the GNU standard C++ library.
Refer to https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html.