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

Enable basic warnings + include correct headers + remove Travis CI #148

Merged
merged 10 commits into from
Nov 4, 2020

Conversation

audrow
Copy link
Contributor

@audrow audrow commented Oct 27, 2020

This PR is a continuation of ros2#22 and enables -Wall, -Wextra, -Wpedantic. It should also fix #147.

audrow and others added 7 commits October 15, 2020 11:56
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@audrow audrow changed the title Enable basic warnings Enable basic warnings + include correct headers Oct 27, 2020
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
@audrow
Copy link
Contributor Author

audrow commented Oct 27, 2020

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

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This works for me, but I'd like @scpeters and/or @sloretz take a look at it before we merge.

add_library(urdfdom_world SHARED
src/pose.cpp
src/model.cpp
src/link.cpp
src/joint.cpp
src/world.cpp)
target_include_directories(urdfdom_world PUBLIC
target_include_directories(urdfdom_world SYSTEM PUBLIC
Copy link
Contributor

Choose a reason for hiding this comment

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

this SYSTEM keyword is applied not only to TinyXML_INCLUDE_DIRS, but also to $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> and $<INSTALL_INTERFACE:include>. is that ok? would it be better to split into separate calls to target_include_directories, one with SYSTEM and one without?

I don't know enough about how this works

Copy link
Contributor

Choose a reason for hiding this comment

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

this SYSTEM keyword is applied not only to TinyXML_INCLUDE_DIRS, but also to $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> and $<INSTALL_INTERFACE:include>. is that ok? would it be better to split into separate calls to target_include_directories, one with SYSTEM and one without?

I think that would work. @audrow can you give that a shot?

@scpeters
Copy link
Contributor

the travis-ci build can't find tinyxml_vendor

@clalancette
Copy link
Contributor

the travis-ci build can't find tinyxml_vendor

Yeah, travis isn't going to work on the ros2 branch because of this. My suggestion is to just remove travis for this branch; we'll get coverage via the Rpr job anyway.

@scpeters
Copy link
Contributor

My suggestion is to just remove travis for this branch

👍

@traversaro
Copy link
Contributor

the travis-ci build can't find tinyxml_vendor

Yeah, travis isn't going to work on the ros2 branch because of this. My suggestion is to just remove travis for this branch; we'll get coverage via the Rpr job anyway.

What is the strategy regarding the GitHub releases for this repo? If future 2.* release of this repo will be tagged/released on the ros2 branch, then depending on "ROS2 as a software distribution" details such as looking tinyxml_vendor and console_bridge_vendor will mean that it will not be possible to package this repo for vcpkg, conda-forge or any "normal" Linux distribution (see https://repology.org/project/urdfdom/versions). Indeed, actually conda-forge already contains a patch to remove exactly those lines: https://github.com/conda-forge/urdfdom-feedstock/blob/master/recipe/remove_vendor.patch .

cc @wolfv @Tobias-Fischer

@clalancette
Copy link
Contributor

What is the strategy regarding the GitHub releases for this repo?

It's a good question, and one that I've been pondering as well. In short, I don't know. The original goal here was to bring https://github.com/ros2/urdfdom back into this repository so we can have less divergence.

As it stands, any PR against the ros2 branch here is going to fail travis because of those extra vendor calls. On the other hand, we need to have the find_package(*_vendor) lines for this to work in the ROS 2 distributions.

Two ways to resolve this conflict that come to mind:

  1. Do what we are currently doing, and make downstreams who want to consume this package patch out those lines. It's not really nice to the downstreams, but it is a simple patch.
  2. Remove the find_package(*_vendor) here, and switch urdfdom to be itself vendored in the ROS 2 distributions. Then the ROS 2 distributions would have a urdfdom_vendor CMakeLists.txt, which could have the find_package(*_vendor) package in them, which I think would do the same thing.

There may be other ways to handle it that I'm not thinking of.

Regardless, I don't think this should hold up this particular PR. My suggestion to move forward here (and with #146) is to remove travis for now. Once we decide on a strategy going forward, we can reenable travis if we want.

@wolfv
Copy link

wolfv commented Oct 29, 2020

you could also have a cmake option 'USE_ROS_VENDOR'?

@clalancette
Copy link
Contributor

you could also have a cmake option 'USE_ROS_VENDOR'?

Yeah, that's another way to do it. In order to play nicely in the ROS 2 builds, it would have to be enabled by default, and then downstreams could do -DUSE_ROS_VENDOR=OFF.

@traversaro
Copy link
Contributor

traversaro commented Oct 29, 2020

The USE_ROS_VENDOR seems to be a nice compromise, and it could be set to OFF in the Travis build to ensure that we don't break the non-ROS2 build.

@traversaro
Copy link
Contributor

fyi I guess that @j-rivero as the Debian urdfdom maintainer could be interested in this discussion.

@traversaro
Copy link
Contributor

Then the ROS 2 distributions would have a urdfdom_vendor CMakeLists.txt, which could have the find_package(*_vendor) package in them, which I think would do the same thing.

While I think USE_ROS_VENDOR CMake option is by far the best compromise, but just to clarify: I do not think it is the same thing to start adding distribution-specific change to a new version of package (such as urdfdom) that is already packaged in many existing and used package managers, as opposed to add distribution-specific changes to packages (such as the vast majority of packages in ROS2) that are not not packaged in almost any package manager.

@clalancette
Copy link
Contributor

While I think USE_ROS_VENDOR CMake option is by far the best compromise, but just to clarify: I do not think it is the same thing to start adding distribution-specific change to a new version of package (such as urdfdom) that is already packaged in many existing and used package managers, as opposed to add distribution-specific changes to packages (such as the vast majority of packages in ROS2) that are not not packaged in almost any package manager.

Just to be clear; this situation already exists today. The only difference is that it is now more visible since I merged the ros2 code into here.

And to be further clear; if we went the route of having a urdfdom_vendor package in ROS 2, then we wouldn't have any calls to find_package(console_vendor) or find_package(tinyxml_vendor) in here at all. At that point, we could consider deprecating the ros2 branch in this repository completely and always just using master. Then downstreams would not have to do anything at all to use the sources; they would just build outside of a ROS environment.

I personally like that idea the best, though I'm not yet 100% convinced it will work in practice.

@traversaro
Copy link
Contributor

traversaro commented Oct 29, 2020

Just to be clear; this situation already exists today. The only difference is that it is now more visible since I merged the ros2 code into here.

I totally agree, but to clarify what I meant: as a downstream packager of urdfdom, from my point of view the ros2/urdfdom fork or the ros2 branches are fork/branches like any other, so the problematic situation does not exists yet. The problem will arise as soon as a new release will be tagged on this repo: at that point, if the release is tagged from the ros2 branch, then the problem will "exists" . Until then, indeed there is no problem at all.

@traversaro
Copy link
Contributor

Actually I just noticed that tags such as https://github.com/ros/urdfdom/tree/2.3.3 are now present in the repo, so I would say that the problem emerged as those tags were added to this repo.

@clalancette
Copy link
Contributor

@sloretz had another idea, which is to just switch those calls to find_package(console_bridge_vendor) to find_package(console_bridge_vendor QUIET). That way, we use the vendored library in the places we want to (ROS 2 builds), but it still picks up the system version if that is not available. @traversaro @wolfv what do you think about that?

@traversaro
Copy link
Contributor

@sloretz had another idea, which is to just switch those calls to find_package(console_bridge_vendor) to find_package(console_bridge_vendor QUIET). That way, we use the vendored library in the places we want to (ROS 2 builds), but it still picks up the system version if that is not available. @traversaro @wolfv what do you think about that?

Both this and the USE_ROS_VENDOR solution are fine for me, with this one I am a bit afraid that on the ROS2 side it would be more complicate to detect if for some reason console_bridge_vendor or tinyxml_vendor are not installed, as you would not get a clean error, but clearly that is a trade-off that is up to the maintainers evaluate.

@clalancette
Copy link
Contributor

To move forward with this PR, my suggestion is to just remove .travis.yml for now. Once this and #146 are in, I'll do a follow-up to make the vendor packages essentially optional, and restore travis at that time.

@audrow Can you remove travis.yml, and respond to @scpeters review here?

@audrow
Copy link
Contributor Author

audrow commented Nov 2, 2020

@clalancette, will do.

Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Signed-off-by: Audrow Nash <audrow.nash@gmail.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Looks good with green CI.

@audrow audrow changed the title Enable basic warnings + include correct headers Enable basic warnings + include correct headers + remove Travis CI Nov 3, 2020
@audrow
Copy link
Contributor Author

audrow commented Nov 3, 2020

I ran tests for urdf as well as urdfdom, because I wanted to make sure that our changes to the CMakeLists file didn't break packages using urdfdom.

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

@audrow
Copy link
Contributor Author

audrow commented Nov 3, 2020

@clalancette or @scpeters, could you merge this PR in? I don't have permissions to.

Also, I believe that ros2/urdfdom can be archived now.

@clalancette
Copy link
Contributor

Woohoo, green CI! I'll wait for final approval from @scpeters before merging.

@audrow audrow requested a review from scpeters November 3, 2020 22:23
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.

5 participants