-
Notifications
You must be signed in to change notification settings - Fork 31
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
Correct CMake Logic and update cpplint to Python3 #117
Conversation
Since we don't call this logic directly in the ign-cmake package, I think it would be worth checking cpplint results on a few of the other packages in the ign suite to make sure that warnings/errors haven't diverged from the version we were using previously. |
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.
checking cpplint results on a few of the other packages
+1
I see 1967 complaints in |
ugh, that seems to complain about our style 😬 |
I wonder if we had made changes to cpplint.py? |
I looked at the diff, and it wasn't obvious that we made any changes. But that's certainly a huge difference. |
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.
This PR seems to fix the issue of cppcheck not working with Ubuntu focal 👍
However, similar to what @scpeters mentioned, I got 11983 errors when running make codecheck
on the main
branch of ign-gazebo
. If I got back to the released version of ign-cmake2
, I get no errors when running make codecheck
on the main
branch of ign-gazebo
.
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
1677a03
to
ebc2fca
Compare
how do you feel about adding a file or readme next to cpplint.py that documents where it came from? it's a little easier to find than looking back in the GitHub PR discussion |
Ah, I had originally put a permalink to the upstream, but I must have removed it at some point. I'll add it back in for clarity 👍 |
I got the following error when testing
According to git blame, that block was last edited in 2014 (cpplint/cpplint@02af628). It looks like |
I already dropped a few of those headers, I'm thinking we can drop that category |
+1 |
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
Here are the connecting blueprint PRs that should resolve the codecheck issues introduced by this PR:
There are a few repositories that I couldn't fix:
The codecheck errors produced by these repositories are generated by |
I think we could suppress these with a |
That seemed to do the trick for For |
Did you try using Otherwise, I think it would be ok to add an empty |
it's a do - while loop, so we can't add a |
Yeah, but I was still getting the false positive.
Like @scpeters said, I can't add
|
ha, I should have scrolled, I was wondering how that loop ever ended 😬 If the problem is that the while is split in 2 lines, maybe putting it all in one line is the solution? The |
That worked! I'll make the PR for |
gazebosim/gz-sim#443 is the only thing left holding this one up. |
All connecting PRs have now been merged, so I believe this PR is ready to merge now. |
Thanks for doing the work on those! |
They haven't all been forward-ported though 😉 |
Good point! Should I make some PRs that forward-port them, or do any of the other branches need to wait before forward porting? |
That would be very helpful! I'm forward-porting |
set(PYTHON_VERSION "3") | ||
endif() | ||
|
||
find_package(PythonInterp ${PYTHON_VERSION} REQUIRED) |
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.
does this mean python
is now a required dependency of ignition-cmake2
? the homebrew bottle build of 2.6.0 in osrf/homebrew-simulation#1222 is failing
https://build.osrfoundation.org/job/generic-release-homebrew_triggered_bottle_builder/label=osx_mojave/124/
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.
I think we might want this to be QUIET
instead of REQUIRED
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.
does this mean python is now a required dependency of ignition-cmake2?
I think that this is what this line implies, although I'm not sure if we meant to create this dependency or not.
I think we might want this to be QUIET instead of REQUIRED
If we do need python though, what would the implications be of replacing REQUIRED
with QUIET
? I'm wondering if marking this QUIET
can cause issues elsewhere if python is not found. @mjcarroll, what are your thoughts?
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.
If it's an optional dependency that's only needed for optional modules (e.g. testing?), then whatever modules depend on it should check ${PythonInterp_FOUND}
to conditionally build only if this package was found. If the package was found, then the module should skip being built.
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.
we can continue the discussion in #132, which proposes to revert python3 to an optional dependency
Prior to #117, python was an optional dependency; this restores that behavior. Signed-off-by: Steve Peters <[email protected]>
Prior to #117, python was an optional dependency; this restores that behavior. * IgnPython: find PythonInterp with QUIET instead of REQUIRED * IgnCodeCheck: skip cpplint if python is not found Signed-off-by: Steve Peters <[email protected]>
Prior to #117, python was an optional dependency; this restores that behavior. * IgnPython: find PythonInterp with QUIET instead of REQUIRED * IgnCodeCheck: skip cpplint if python is not found Signed-off-by: Steve Peters <[email protected]>
For Python3 compatibility, this updates the version of cpplint to the latest version available on their repo: https://github.com/cpplint/cpplint/blob/0f2319741f3407d8638cdc7c41e4fc9bad217f68/cpplint.py
I also adjusted the CMake logic to prefer the Python3 interpreter when available. This logic can be further improved once CMake 3.12 is available across our supported platforms: https://cmake.org/cmake/help/v3.12/module/FindPython.html
Resolves #116