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

Don't fail build if lsan isn't available #397

Merged
merged 5 commits into from
Apr 30, 2020
Merged

Don't fail build if lsan isn't available #397

merged 5 commits into from
Apr 30, 2020

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Apr 30, 2020

Since lsan isn't a required dependency for these packages, they shouldn't fail to build when it isn't present.

Note that part of using a sanitizer involves additional libraries, so using check_cxx_compiler_flag might not fail because it doesn't perform linking like check_cxx_source_compiles does.

Alternatively, the sanitizer(s) could be added either to the ROS 2 installation instructions or as an explicit dependency for these packages.

Since lsan isn't a required dependency for these packages, they
shouldn't fail to build when it isn't present.

Note that part of using a sanitizer involves additional libraries, so
using check_cxx_compiler_flag might not fail because it doesn't perform
linking like check_cxx_source_compiles does.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay cottsay self-assigned this Apr 30, 2020
Copy link
Collaborator

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

This generally looks good to me.

As mentioned inline, I wonder why we have the sanitizers in the compression package. I couldn't find a place where this is used. I think that could be removed all together. I not, I think I would like to have this cmake logic somewhere central, to lower the maintenance effort of it.

wrt to your alternatives, do you have an idea who to add optional test dependencies?

rosbag2_compression/CMakeLists.txt Outdated Show resolved Hide resolved
rosbag2_cpp/CMakeLists.txt Outdated Show resolved Hide resolved
@cottsay
Copy link
Member Author

cottsay commented Apr 30, 2020

wrt to your alternatives, do you have an idea who to add optional test dependencies?

On Fedora, the missing package is liblsan, which contains the missing liblsan.so.* files. This probably hasn't been an issue on Ubuntu because that library is part of the main libgcc-*-dev package. Looks like Arch is similar.

Maybe this is just a Redhat thing?

Signed-off-by: Scott K Logan <logans@cottsay.net>
@Karsten1987
Copy link
Collaborator

I am okay with this solution. I am waiting for @zmichaels11 or maybe @piraka9011 to comment on the usage within the compression. But it generally looks good to me overall.

@Karsten1987
Copy link
Collaborator

@cottsay do you mind triggering a CI for this? Just making sure that our main platforms don't experience any hiccups with this.

cottsay and others added 2 commits April 30, 2020 14:22
Signed-off-by: Scott K Logan <logans@cottsay.net>

Co-authored-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay
Copy link
Member Author

cottsay commented Apr 30, 2020

@cottsay do you mind triggering a CI for this?

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@cottsay
Copy link
Member Author

cottsay commented Apr 30, 2020

Interesting - the check failed on macOS. I'll look into it.

Signed-off-by: Scott K Logan <logans@cottsay.net>
@cottsay
Copy link
Member Author

cottsay commented Apr 30, 2020

Interesting - the check failed on macOS. I'll look into it.

I see, the flags only get added later for GCC. I made the test only happen for GCC then, which preserves the behavior of leaving DISABLE_SANITIZERS as OFF on Clang. Let me know if you think there is a better approach.

Side note - the test silently succeeds on MSVC even though the flag isn't supported. It looks like cl treats unknown arguments as non-fatal. Interesting.

Reruns:

  • Linux Build Status
  • macOS Build Status

@Karsten1987 Karsten1987 merged commit 60c35d2 into master Apr 30, 2020
@delete-merged-branch delete-merged-branch bot deleted the no_lsan branch April 30, 2020 23:33
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.

None yet

4 participants