Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Catkin plugin: Add support for ROS tools. #152
Conversation
sergiusens
reviewed
Dec 4, 2015
| + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} | ||
| + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
| +) |
sergiusens
reviewed
Dec 4, 2015
| @@ -105,6 +105,7 @@ def env(self, root): | ||
| root, | ||
| self.options.rosversion), | ||
| 'ROS_MASTER_URI=http://localhost:11311', |
kyrofa
Dec 4, 2015
Member
Heh, I don't quite understand what you're trying to draw my attention to. That you'd like that variable removed eventually?
sergiusens
Dec 4, 2015
Collaborator
That maybe it eventually is expected to run on a different port. But I'm not sure that is configurable.
kyrofa
Dec 4, 2015
Member
Ah, okay. It is actually configurable, I just need to figure out how to do that with Snappy, which I'll make a different PR.
elopio
reviewed
Dec 4, 2015
| + plugin = catkin.CatkinPlugin('test-part', self.properties) | ||
| + | ||
| + with mock.patch.object(builtins, 'open', | ||
| + mock.mock_open(read_data=package_xml)): |
kyrofa
Dec 4, 2015
Member
Indeed I could, but I feel like actually hitting the filesystem when I don't need to feels a bit brittle and slow.
elopio
Dec 4, 2015
Member
In unit tests, I prefer to access the filesystem in temp directories instead of mocking that part.
But your test is correct, if you prefer it this way, I'm ok with that.
elopio
reviewed
Dec 4, 2015
| + 'ros-foo-buildtool-depend', | ||
| + 'ros-foo-build-depend', | ||
| + 'ros-foo-run-depend']), | ||
| + mock.call().unpack(plugin.installdir)]) |
sergiusens
reviewed
Dec 4, 2015
| @@ -105,6 +105,7 @@ def env(self, root): | ||
| root, | ||
| self.options.rosversion), | ||
| 'ROS_MASTER_URI=http://localhost:11311', | ||
| + 'ROS_HOME=$SNAP_APP_USER_DATA_PATH/.ros', |
sergiusens
Dec 4, 2015
Collaborator
To avoid future misgivings, can we add a comment on why this is needed?
sergiusens
reviewed
Dec 4, 2015
| - 'opt/ros/' + self.options.rosversion + '/.rosinstall', | ||
| - 'opt/ros/' + self.options.rosversion + '/setup.sh', | ||
| - 'opt/ros/' + self.options.rosversion + '/_setup_util.py'], | ||
| + 'opt/ros/' + self.options.rosversion + '/.rosinstall'], |
sergiusens
Dec 4, 2015
Collaborator
os.remove(os.path.join(self.installdir, self.options.rosversion, '.rosinstall'))
elopio
Dec 4, 2015
Member
This deserves an integration test, to check that the files you want end up in the right dirs.
Feel free to add that in a later branch, because that's debt from before.
sergiusens
Dec 4, 2015
Collaborator
Oh, and if you know why it is being removed, a comment would be great
ted-gould
Dec 4, 2015
Contributor
It shouldn't need to be removed, but can be filtered now that the filters are fixed. Never got around to replacing the rm with proper stage filters.
elopio
reviewed
Dec 4, 2015
| cwd=self.installdir) | ||
| + # Fix the shebang in _setup_util.py to be portable |
elopio
Dec 4, 2015
Member
It would be nice to have a unittest for the shebang.
Aren't we doing this already in the python plugin? Maybe we can share some code, and unit test that.
sergiusens
Dec 4, 2015
Collaborator
It's been moved to meta. If we want to share it I'd move it to another module.
kyrofa
Dec 4, 2015
Member
I agree, but ALL the build steps here need test coverage, which I plan on adding in a later PR.
|
I like this very much. One followup question is; do we need the |
|
@sergiusens I was wondering that myself. Let me experiment, this PR may have enabled the removal of it. |
|
Alright I believe I've resolved all the concerns for this one. I will continue to increase test coverage throughout subsequent PRs, and will remove the roscore plugin once the blocking bug has been resolved. |
|
The example fails to build with: usr/bin/xml2-config |
|
@elopio oh interesting, I didn't consider the interplay between plugins! I will add that to my manual test procedure. xml2-config isn't a required file, so I have temporarily added the removal of it back to the catkin plugin until we can remove roscore. |
|
@elopio and @kyrofa fwiw, plugins aren't supposed to solve all the conflicts in the world, that is to some extent part of the part author's responsibility. That does no rule out plugins themselves should try to deliver the cleanest environment possible, but not in detriment of its functionality. In the example of |
|
I'm |
|
Me too. Merging. |
kyrofa commentedDec 4, 2015
The current Catkin plugin distributes only the built version of a ROS package that would typically go into the devel workspace, but that version doesn't include non-source, non-binary files, such as .launch files. This PR changes the plugin to actually install ROS packages, thereby including any non-source, non-binary files specified by the developer.
This PR also updates the wrapper environment to correctly setup the ROS environment, which allows for the use of typical ROS tools within the snapcraft.yaml, such as roslaunch, rosrun, etc., and updates the ROS examples to make use of them.
Finally, this PR also increases the test coverage of the Catkin plugin twofold.