Skip to content
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

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

rico-chet
Copy link
Contributor

@rico-chet rico-chet commented Nov 26, 2023

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.

@rico-chet rico-chet marked this pull request as ready for review November 26, 2023 16:59
@rico-chet rico-chet marked this pull request as draft November 26, 2023 17:13
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.
@rico-chet rico-chet force-pushed the use-debug-libcpp-on-ubuntu-ci branch from 0972a2f to 1b506b4 Compare November 26, 2023 17:32
@rico-chet rico-chet changed the title workflows/build.yml: Use debug std C++ library workflows/build.yml: Use debug std C++ library on Ubuntu Nov 26, 2023
@rico-chet rico-chet marked this pull request as ready for review November 26, 2023 17:33
@rico-chet
Copy link
Contributor Author

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' }}
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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?

Copy link

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)

@jbeder jbeder merged commit eaf7205 into jbeder:master Nov 27, 2023
33 checks passed
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