fzi-forschungszentrum-informatik / robot_folders

robot_folders helps you managing multiple source projects with their own workspaces mainly around the ROS ecosystem.
MIT License
45 stars 4 forks source link

Do not die without any installed ROS distro #39

Closed fmauch closed 1 week ago

fmauch commented 2 months ago

People might install ROS by themselves differently, e.g. though a source installation which does not install into /opt/ros or through Robostack.

This commit allows having an empty / non-existing /opt/ros without dying when creating environments (both, catkin and colcon workspaces). The output states that the distro 'None' is used, sourcing without an existing build states that users should take care about sourcing their ROS installation. Building without a source ROS installation will probably lead to errors in the output, but I would leave that to the user's responsibility for now.

E.g. requesting a colcon workspace without an existing ROS installation leads to

Requested to not create a misc workspace
Requested to not create a catkin_ws
Creating colcon_ws
log_dir: /root/checkout/bar2/colcon_ws/log
install_dir: /root/checkout/bar2/colcon_ws/install
Building colcon_ws in /root/checkout/bar2/colcon_ws
Building with command colcon build --symlink-install --cmake-args   -DCMAKE_EXPORT_COMPILE_COMMANDS=1
bash: line 1: colcon: command not found
None
Something went wrong while creating the environment!
Execution of module 'add' failed. Error message:
'None'

Closes #38

@DariusPietschatConbotics if you could test that, that would be really nice!

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 10.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 52.51%. Comparing base (d647765) to head (f6603fd).

Files Patch % Lines
src/robot_folders/helpers/environment_helpers.py 0.00% 16 Missing :warning:
src/robot_folders/helpers/ros_version_helpers.py 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #39 +/- ## ========================================== - Coverage 52.73% 52.51% -0.22% ========================================== Files 27 27 Lines 1479 1489 +10 ========================================== + Hits 780 782 +2 - Misses 699 707 +8 ``` | [Flag](https://app.codecov.io/gh/fzi-forschungszentrum-informatik/robot_folders/pull/39/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fzi-forschungszentrum-informatik) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/fzi-forschungszentrum-informatik/robot_folders/pull/39/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fzi-forschungszentrum-informatik) | `52.51% <10.00%> (-0.22%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=fzi-forschungszentrum-informatik#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DariusPietschatConbotics commented 2 months ago

Hey! I was able to get this working. As you described, the ROS distribution will say None but the initial compilation still starts, if I have my ROS sourced beforehand. After switching branches of robot_folders I managed to run into this issue of catkin_tools. But I don't know if that is related at all.

fmauch commented 1 month ago

Thanks for testing this out @DariusPietschatConbotics. I don't really know why I left this as a draft. But since it is working for you I guess, this can get merged.