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

rmw_cyclonedds GitHub actions broken #220

Closed
joespeed opened this issue Aug 19, 2020 · 11 comments · Fixed by #237
Closed

rmw_cyclonedds GitHub actions broken #220

joespeed opened this issue Aug 19, 2020 · 11 comments · Fixed by #237
Labels
bug Something isn't working

Comments

@joespeed
Copy link
Contributor

joespeed commented Aug 19, 2020

@hidmic @ThijsSassen Please help, thanks! It was pointed out to me today that rmw_cyclonedds GitHub actions are broken https://github.com/ros2/rmw_cyclonedds/actions Seems the actions are set up properly and there is a legit cppcheck failure we need to fix on OS X:
2020-08-14T17:21:06.0550080Z [8.838s] 2: [src/rmw_node.cpp:705]: (error: unknownMacro) There is an unknown macro here somewhere. Configuration is required. If RCUTILS_STRINGIFY is a macro then please configure it.

@christophebedard
Copy link
Member

Might be related/useful: ros2/ros2#942

@ivanpauno
Copy link
Member

See ros2/rosidl_typesupport_connext#57 for an example fix

@joespeed
Copy link
Contributor Author

@ivanpauno thx! might you be able to? Most contributors in Netherlands have holiday. Let me know if not and we'll figure it out

@rotu
Copy link
Collaborator

rotu commented Aug 29, 2020

@ivanpauno That looks like a workaround, not a fix. Why doesn't cppcheck find it in the first place?

@rotu
Copy link
Collaborator

rotu commented Aug 31, 2020

Discovered this bug in trying to work around the issue: https://github.com/rotu/rmw_cyclonedds/actions/runs/232035117

It seems strange to me that rcutils is found in Linux but not on Mac/Windows. Is this caused by cppcheck 2.0 vs <2.0?

@ivanpauno
Copy link
Member

@ivanpauno That looks like a workaround, not a fix. Why doesn't cppcheck find it in the first place?

Include paths of dependencies are not being passed automatically to cppcheck per discussion in ament/ament_lint#117.
The discussion was revisited and this patch was applied in ros2/rclpy#577.

It doesn't look ideal, but it doesn't look to bad either.
If you have any other proposal please open an issue in ament_lint repo.

@ivanpauno ivanpauno added the bug Something isn't working label Aug 31, 2020
@ivanpauno
Copy link
Member

It seems strange to me that rcutils is found in Linux but not on Mac/Windows. Is this caused by cppcheck 2.0 vs <2.0?

I guess the version of cppcheck installed in both platforms is different.
I think that cppcheck <2.0 wasn't finding rcutils either, but it didn't require all macros to be configured (thus, there was no problem).

@rotu
Copy link
Collaborator

rotu commented Aug 31, 2020

Problems at the interfaces of packages are the thorniest. If cppcheck can’t hope to detect such problems then it’s not very useful as a static analysis tool.

What value does cppcheck provide? In the current configuration does it detect anything cpplint doesn’t?

I think we should consider just disabling it.

@ivanpauno
Copy link
Member

What value does cppcheck provide? In the current configuration does it detect anything cpplint doesn’t?

AFAIU, cpplint only does style checking and cppcheck is intended to detect bugs.
I haven't check how we're configuring both, but in general cpplint cannot replace cppcheck (clang-tidy could be a replacement, though some people combine both cppcheck and clang-tidy).

I wouldn't deactivate a linter only because of a one line workaround.
I think that opening an issue upstream to see how the problem can be solved in a better way is worth doing.

@rotu
Copy link
Collaborator

rotu commented Sep 1, 2020

@ivanpauno alternate solution: ament/ament_lint#268

AFAIU, cpplint only does style checking and cppcheck is intended to detect bugs.

Yes, in theory. But that only holds true if it has enough context to detect such bugs.

I didn't recommend deactivating cppcheck because of a one-line workaround. I recommend it because including dependencies makes performance unacceptably bad and not including dependencies makes it unable to perform static analysis in a meaningful way.

I'm not sure why the performance hit was deemed unacceptably bad, but I suspect it's due to misuse of the tool (e.g. not passing definitions to cppcheck so it checks a combinatoric explosion of macro combinations) rather than its inherent limitations.

@iuhilnehc-ynos
Copy link

iuhilnehc-ynos commented Sep 8, 2020

Hi all,

After using cppcheck(v2.1), there seems a workaround (by using ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS) to set '--include-dirs' for ament_cppcheck. But I think it's not good because there is already 'INCLUDE_DIRECTORYS' exist by find_package, why should I set ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS?

I think the following source code might be unreasonable, ( ament/ament_lint#117 (comment) )

https://github.com/ament/ament_lint/blob/58cd08c9f671eba22c9efc222b6f4476b11eec48/ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake#L69-L72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants