Is building into "install" space (officially) recommended?

81 views
Skip to first unread message

Isaac Isao Saito

unread,
Mar 26, 2017, 11:54:26 AM3/26/17
to ros-sig-b...@googlegroups.com
Some people keep telling me so, but I can't find that sort of recommendation (official or not).

Although I can see why using `install` space is a good idea, the basic tutorials don't mention it, so does not Catkin workspaces page.

Also if that's is a recommendation, should we update the basic tutorials?

Thanks,
Isaac

Dirk Thomas

unread,
Mar 26, 2017, 12:29:45 PM3/26/17
to ros-sig-b...@googlegroups.com
I would answer the question with "no". I would say the opposite is the case: you should not touch the install space during the build phase at all.

Let's consider the user invokes the three commands `cmake`, `make`, and `make install` separately (instead of using a build tool like `catkin_tools` which does all that for you). After the `cmake` and `make` call the source code has been compiled and all targets like libraries and executables have been built. They should be located in the build space (or in the case of `catkin` some of them are directly being placed in the devel space). But at that point nothing has touched the install space yet. Only when invoking `make install` the artifacts are being copied to the install space.

If you consider installing a software package into `/usr` (not recommended for ROS packages though!) you only need `sudo` permissions during the `make install` invocation. If your package would try to create files in the install space during the build phase it would fail since `make` is commonly not invoked with `sudo`.

I hope that helps.
- Dirk


--
You received this message because you are subscribed to the Google Groups "ROS Buildsystem Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-buildsystem+unsub...@googlegroups.com.
To post to this group, send email to ros-sig-buildsystem@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-buildsystem/CAFY%2B-ZchQwOf7T71LxisjF0ejETf8D73RNnHdMibu%2BG-otKgpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Isaac I.Y. Saito

unread,
Mar 27, 2017, 4:58:58 PM3/27/17
to ros-sig-b...@googlegroups.com
Thanks Dirk. Now I see this might be more general software development question, but let me still limit to ROS since I have Catkin in mind.

The subject line might have been misleading so let me re-phrase it: Is deploying recommended in ROS?

I've been discussing if we (as in, ROS folks) should recommend developers to write their software as install-able (`make install`-capable) or not.

I'd say no, because there won't be any difference feature-wise for between the software built into devel and install spaces AFAIK, and devel space is very convenient for e.g. rapid prototyping. Basic tutorial mentions nothing about deploy as I cited in my 1st email.
But once the software sustains longer then I can see maintaining it as installable would become more beneficial for its maturity.

Is there any recommendation regarding this?

Thanks,
Isaac


On Sun, Mar 26, 2017 at 9:29 AM, Dirk Thomas <dth...@osrfoundation.org> wrote:
I would answer the question with "no". I would say the opposite is the case: you should not touch the install space during the build phase at all.

Let's consider the user invokes the three commands `cmake`, `make`, and `make install` separately (instead of using a build tool like `catkin_tools` which does all that for you). After the `cmake` and `make` call the source code has been compiled and all targets like libraries and executables have been built. They should be located in the build space (or in the case of `catkin` some of them are directly being placed in the devel space). But at that point nothing has touched the install space yet. Only when invoking `make install` the artifacts are being copied to the install space.

If you consider installing a software package into `/usr` (not recommended for ROS packages though!) you only need `sudo` permissions during the `make install` invocation. If your package would try to create files in the install space during the build phase it would fail since `make` is commonly not invoked with `sudo`.

I hope that helps.
- Dirk

On Sun, Mar 26, 2017 at 8:53 AM, Isaac Isao Saito <gm1...@gmail.com> wrote:
Some people keep telling me so, but I can't find that sort of recommendation (official or not).

Although I can see why using `install` space is a good idea, the basic tutorials don't mention it, so does not Catkin workspaces page.

Also if that's is a recommendation, should we update the basic tutorials?

Thanks,
Isaac

--
You received this message because you are subscribed to the Google Groups "ROS Buildsystem Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-buildsystem+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ROS Buildsystem Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-buildsystem+unsub...@googlegroups.com.
To post to this group, send email to ros-sig-buildsystem@googlegroups.com.

Dirk Thomas

unread,
Mar 27, 2017, 5:05:24 PM3/27/17
to ros-sig-b...@googlegroups.com
On Mon, Mar 27, 2017 at 1:58 PM, Isaac I.Y. Saito <iis...@kinugarage.com> wrote:
Thanks Dirk. Now I see this might be more general software development question, but let me still limit to ROS since I have Catkin in mind.

The subject line might have been misleading so let me re-phrase it: Is deploying recommended in ROS?

I've been discussing if we (as in, ROS folks) should recommend developers to write their software as install-able (`make install`-capable) or not.

I'd say no, because there won't be any difference feature-wise for between the software built into devel and install spaces AFAIK, and devel space is very convenient for e.g. rapid prototyping. Basic tutorial mentions nothing about deploy as I cited in my 1st email.
But once the software sustains longer then I can see maintaining it as installable would become more beneficial for its maturity.

Is there any recommendation regarding this?

Imo writing install rules for every CMake project is crucial. You shouldn't rely on users using the devel space. Many might just want to use the install space and a package wouldn't work in that case. And yes, once you want to release your packages they must have install rules.

Looking into the future in ROS 2 the "devel space feature" has been intentionally remove since it require pretty ugly hacks and special handling in many ROS packages (see http://design.ros2.org/articles/ament.html#devel-space for more details about that). So you might want to get used to use the install step ;-) 

Cheers,
- Dirk

Jack O'Quin

unread,
Mar 28, 2017, 2:48:20 PM3/28/17
to ros-sig-b...@googlegroups.com

On Mon, Mar 27, 2017 at 3:58 PM, Isaac I.Y. Saito <iis...@kinugarage.com> wrote:
Thanks Dirk. Now I see this might be more general software development question, but let me still limit to ROS since I have Catkin in mind.

The subject line might have been misleading so let me re-phrase it: Is deploying recommended in ROS?

I've been discussing if we (as in, ROS folks) should recommend developers to write their software as install-able (`make install`-capable) or not.

I'd say no, because there won't be any difference feature-wise for between the software built into devel and install spaces AFAIK, and devel space is very convenient for e.g. rapid prototyping. Basic tutorial mentions nothing about deploy as I cited in my 1st email.
But once the software sustains longer then I can see maintaining it as installable would become more beneficial for its maturity.

Is there any recommendation regarding this?

In my experience, building and testing with install space is a useful preliminary to releasing a package to the build farm.
--
 joq

Daniel Stonier

unread,
Mar 28, 2017, 4:09:18 PM3/28/17
to ros-sig-b...@googlegroups.com

Basic rule of thumb for us was - if your only users are you and perhaps a few other devs that are all building the package from source, then devel space is sufficient. Writing install rules at this stage is annoying and probably more pertinent, full of bugs since you do not actively use it. 

As soon as you have users who do not want to compile the project and need binaries - whether that is an OSRF build farm deb, your own bundled package, or even just a binary tarball of the install space, then you need the install rules. You'll also close the loop that will help you fix problems for those rules too.

Note - using install spaces is quite convenient. Even in the same team, if you can relegate any code to a distrubutable (e.g. deb, tarball, or rsync to a server) install space, then your developers need only rosinstall and compile the small part of the workspace they need to be focused on.

Daniel


--
You received this message because you are subscribed to the Google Groups "ROS Buildsystem Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-buildsystem+unsub...@googlegroups.com.
To post to this group, send email to ros-sig-buildsystem@googlegroups.com.

Isaac Isao Saito

unread,
Apr 4, 2017, 5:39:23 PM4/4/17
to ros-sig-b...@googlegroups.com
Thanks all for sharing thoughts. Now I'm convinced that using install space is encouraged, even for novice users maybe.


On Mon, Mar 27, 2017 at 2:05 PM, Dirk Thomas <dth...@osrfoundation.org> wrote:
>
> Imo writing install rules for every CMake project is crucial. You shouldn't rely on users using the devel space. Many might just want to use the install space and a package wouldn't work in that case. And yes, once you want to release your packages they must have install rules.
>
> Looking into the future in ROS 2 the "devel space feature" has been intentionally remove since it require pretty ugly hacks and special handling in many ROS packages (see http://design.ros2.org/articles/ament.html#devel-space for more details about that). So you might want to get used to use the install step ;-)

Ok, got it.

Then my next concern is that there isn't a hands-on tutorial AFAIK where esp. newer coders can try adding install space (i.e. where they add changes to CMakeLists.txt, setup.sh etc., then run `catkin_make install`, `source install/setup.*sh`, then validate their app).
  • docs.ros.org/api/catkin page has a good instruction but these are for intermediate+ developers, and missing hands-on materials.
  • The existing tutorial pages on wiki.ros.org/ROS/Tutorials, we probably want to keep them immutable for such a non-trivial change? But maybe we can add a new page?
Isaac
>> email to ros-sig-buildsy...@googlegroups.com.
>> To post to this group, send email to ros-sig-b...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "ROS Buildsystem Special Interest Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ros-sig-buildsy...@googlegroups.com.
> To post to this group, send email to ros-sig-b...@googlegroups.com.

> To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages