-
Notifications
You must be signed in to change notification settings - Fork 164
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
Make ros2doctor depend on ros_environment and fix platform.py bug on error. #538
Conversation
Since it technically needs ROS_DISTRO defined for it to work, that means it also has an exec_depend on ros2doctor. Put that in here. Also make the code a little more robust to tests that may fail and return None. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
You mentioned it in an offline discussion but since the diff doesn't include any mention of the ROS_DISTRO variable a description of the failure mode without the ros_environment package (which is the canonical provider of the ROS_DISTRO environment variable) would be welcome in the PR description. To answer another offline question, there is no reason not to add a dependency on ros_environment and we've been recommending a build dependency on it for anyone whose build process wants to check the ROS_DISTRO, ROS_VERSION, or ROS_PYTHON_VERSION. |
Good point, will add that.
👍 |
That is, it should return the empty ros_report, not "None". Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
(Maybe update the title to mention the additional change happening in the patch.) |
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.
LGTM with green CI!
@ros-pull-request-builder retest this please |
PR tests are flakey, so going ahead and merging this one. |
…error. (ros2#538) * Make ros2doctor depend on ros_environment. Since it technically needs ROS_DISTRO defined for it to work, that means it also has an exec_depend on ros2doctor. Put that in here. Also make sure RosDistroReport returns a valid report on error. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> Signed-off-by: Craig Hickman <craig.hickman@ukaea.uk>
The ros2doctor package check requires ROS_DISTRO to be defined in the environment. If it is not, you get warnings like:
Since that environment variable comes from the
ros_environment
package, that means this package has anexec_depend
onros_environment
. Add that here.While we are in here, also notice that platform.py returns a "None" value if
_check_platform_helper
fails. However, it's contract states:Thus, make sure to return an empty report on error, which fixes possible crashes and also conforms to what other reports do.
Signed-off-by: Chris Lalancette clalancette@openrobotics.org