Fix[build]: Don't build libbmq with SAFE asserts in RelWithDebInfo builds - #1243
Closed
pniedzielski wants to merge 2 commits into
Closed
Fix[build]: Don't build libbmq with SAFE asserts in RelWithDebInfo builds#1243pniedzielski wants to merge 2 commits into
pniedzielski wants to merge 2 commits into
Conversation
In `bmq_add_application_test`, there were originally two separate
if-blocks checking `${lib_target}_TEST_TARGETS`. The first imported
test dependencies, and the second handled `.td` test driver manifest
generation before also importing test dependencies. When the `.td`
target logic was removed in commit 595bdd8, the second block was
reduced to just the `bbs_import_target_dependencies` call, making it
an exact duplicate of the first. This patch removes the redundant
second block.
Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
The build previously used a global `add_definitions()` to enable `BSLS_ASSERT_LEVEL_ASSERT_SAFE` on all targets in non-Release builds. This includes libbmq, which users may link against in production `RelWithDebInfo` builds. Enabling SAFE asserts in libbmq can be a breaking change for those users by introducing assertion failures that do not occur in Release builds. This patch removes the global definition and instead enables safe asserts selectively, for mqb, applications, and test targets. libbmq itself no longer gets the definition, but all of its unit tests still do. In the future, we should consider building libbmq with `BSLS_ASSERT_LEVEL_ASSERT_SAFE` in CI using CMakePresets, or perhaps controlling this entirely from CMakePresets. For the moment, this patch is a simple fix that prevents us from breaking users while we figure out the best way to handle this. Signed-off-by: Patrick M. Niedzielski <pniedzielski@bloomberg.net>
Collaborator
|
I'm a little skeptical of getting this fine-grained with where SAFE asserts are enabled. I think it may be fine to keep the current global option of always use safe unless otherwise specified in a configure variable that we just make up, e.g. |
Collaborator
Author
|
Let me give that a shot. |
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.
Please see commit messages for details.