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

Correctly detect when gem is not available #823

Conversation

christophebedard
Copy link
Member

@christophebedard christophebedard commented Jun 26, 2021

Relates to #821

Currently, when trying to install dependencies from the gem installer when gem isn't installed, we get this:

$ rosdep install --rosdistro rolling --from-paths src/test_pkg_gem

ERROR: Rosdep experienced an internal error.
Please go to the rosdep page [1] and file a bug report with the message below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.21.0

Bad installer [gem]: [Errno 2] No such file or directory: 'gem'

This is with a workspace that has a single package.xml file with a single gem dependency: <depend>metaruby</depend>. The error message isn't really clear; users shouldn't really be asked to open an issue in this case.

This fix is just doing what the pip installer does: if gem isn't installed, then none of the resolved packages are currently installed on the system, so we can simply return right away. Later on, when we try to install them, we finally get to raise an error saying that gem isn't installed (in GemInstaller.get_install_command()). We get this:

$ rosdep install --rosdistro rolling --from-paths src/test_pkg_gem
ERROR: the following rosdeps failed to install
  gem: gem is not installed

This is the same as #822.

Signed-off-by: Christophe Bedard [email protected]

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2021

Codecov Report

Merging #823 (371e984) into master (211c5c6) will increase coverage by 0.07%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #823      +/-   ##
==========================================
+ Coverage   74.84%   74.92%   +0.07%     
==========================================
  Files          42       42              
  Lines        3304     3306       +2     
==========================================
+ Hits         2473     2477       +4     
+ Misses        831      829       -2     
Impacted Files Coverage Δ
src/rosdep2/platforms/gem.py 84.61% <50.00%> (+6.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 211c5c6...371e984. Read the comment docs.

@nuclearsandwich
Copy link
Contributor

Thanks for these changes @christophebedard!

@nuclearsandwich nuclearsandwich merged commit 9f58298 into ros-infrastructure:master Jul 1, 2021
@christophebedard christophebedard deleted the correctly-detect-when-gem-is-not-available branch July 1, 2021 19:58
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.

3 participants