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

update universal build tool article to reflect decision to use colcon #168

Merged
merged 16 commits into from
Jun 15, 2018
160 changes: 111 additions & 49 deletions articles/101_build_tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: default
title: A universal build tool
permalink: articles/build_tool.html
abstract:
This article describes the rationale for a universal build tool.
This article describes a universal build tool for ROS 1 and ROS 2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as part of the goals is to have this build tool ROS independent. Do we need to narrow it to ROS 1 and ROS 2 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind either or. I reverted the change to the abstract sentence to keep it as is: c57a468.

published: true
author: '[Dirk Thomas](https://github.com/dirk-thomas)'
categories: Overview
Expand All @@ -19,15 +19,6 @@ categories: Overview

Original Author: {{ page.author }}

<div class="alert alert-info" markdown="1">
<b>NOTE:</b>
The work towards a unified build tool have been reprioritized.
Nobody is currently planning to spend any time towards the described goals.

While the article in its current state describes the use cases, goals as well as the rational behind it, and mentions possible approaches moving forward, it does not propose a specific path forward at the moment.

</div>

## Preface

In the ROS ecosystem the software is separated into numerous packages.
Expand All @@ -40,23 +31,23 @@ Such a workflow is impracticable at scale without a tool that automates that pro

A build tool performs the task of building a set of packages with a single invocation.
For ROS 1 multiple different tools provide support for this, namely `catkin_make`, `catkin_make_isolated`, and `catkin_tools`.
For ROS 2 the build tool providing this functionality is called `ament_tools`.
For ROS 2 up to the Ardent release the build tool providing this functionality is called `ament_tools`.

This article describes the steps to unify these build tools as well as extend the field of application.

## Goal

The goal of a unified build tool is to build a set of packages with a single invocation.
It should work with ROS 1 packages as well as ROS 2 packages which provide the necessary information in their manifest files.
It should also work with packages that do not provide manifest files themselves, given that the meta information is externally provided.
This will allow the build tool to be utilized for non-ROS packages (e.g. Gazebo including its dependencies).
It should also work with packages that do not provide manifest files themselves, given that the necessary meta information is provided externally.
This will allow the build tool to be utilized for non-ROS packages (e.g. Gazebo including its ignition dependencies).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this now restricted to ignition deps? this wouldnt work for e.g. sdformat?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not "restricted". It is just an example:

e.g. ...


In the ROS ecosystems several tools already exist which support this use case (see below).
Each of the existing tools performs similar tasks and duplicates a significant amount of the logic.
As a consequence of being developed separately certain features are only available in some of the tools while other tools lack those.

The reason to work on a single universal build tool comes down to reducing the effort necessary for development and maintenance.
Additionally this makes new features developed once available for all the use cases.
The reason to use a single universal build tool comes down to reducing the effort necessary for development and maintenance.
Additionally this makes newly developed features available for all the use cases.

### Build Tool vs. Build System

Expand Down Expand Up @@ -136,15 +127,15 @@ It automates the generation of CMake config files as well as pkg-config files.
It additionally provides functions to register different kinds of tests.

A package using `catkin` specifies its meta data in a manifest file named `package.xml`.
The format of the manifest file is specified in the [ROS REP 140](http://www.ros.org/reps/rep-0140.html).
The latest format of the manifest file is specified in the [ROS REP 149](http://www.ros.org/reps/rep-0149.html).

### ament_cmake

[ament_cmake](https://github.com/ament/ament_cmake) is an evolution of `catkin` and is also based on CMake.
The main difference between `ament_cmake` and `catkin` is described in [another article](http://design.ros2.org/articles/ament.html).
In the context of the build tool the biggest difference is that `ament_cmake` generates package-specific files to setup the environment to use the package after it has been built and installed.

A package using `ament_cmake` uses the same manifest file as `catkin` (except that it only allows the newer format version 2).
A package using `ament_cmake` uses the same manifest file as `catkin` (except that it requires format version 2 or higher).

### Python setuptools

Expand Down Expand Up @@ -199,8 +190,9 @@ The tool supports building CMake packages and builds them in isolation as well a

`ament_tools` is provided by a standalone Python 3 package used to build ROS 2 packages.
It was developed to bootstrap the ROS 2 project, is therefore only targeting Python 3, and works on Linux, MacOS and Windows.
In addition to CMake packages it also supports building Python packages and can infer meta information without requiring an explicit package manifest.
In addition to CMake packages it also supports building Python packages and can infer meta information without requiring an explicit package manifest (which is e.g. used for the FastRTPS package).
The tool performs an "isolated" build like `catkin_make_isolated` and `catkin_tools` (one CMake invocation per package) and also parallelizes the build of packages which have no (recursive) dependencies on each other (like `catkin_tools`).
While it covers more build systems and platforms than `catkin_tools` it doesn't have any of `catkin_tools`s usability features like profiles, output handling, etc.

`ament_tools` supports building the following packages:

Expand All @@ -210,9 +202,15 @@ The tool performs an "isolated" build like `catkin_make_isolated` and `catkin_to
- Python package with a `package.xml` file.
- Python package without a manifest file (extracting the package name and dependencies from the `setup.py` file).

### colcon

When the first draft of this article was written the conclusion was to not to spend any resources towards a universal build tool.
As a consequence the author of this article went ahead and developed [colcon](https://github.com/colcon/) as a personal project.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is interesting for me to see how decisions are made at OSRF, maybe this part could still just state the relevant technical facts, such as: "The discussion about the first draft was inconclusive. Colcon was created as a PoC to demonstrate the viability of the approach of a unified build tool layer above respective build-system libraries."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is interesting for me to see how decisions are made at OSRF, maybe this part could still just state the relevant technical facts ...

As any other company OSRF has limited resources. And with that constraint comes the difficult decision what project / part to spend them on. I think it is important to acknowledge that here to provide context to readers why there was no significant development in this area in the past year.

The discussion about the first draft was inconclusive

From my point of view that does not reflect the facts. The previous draft came up with a clear rational why it would be useful to unify the different tools. At the end of the day no party was willing to put the necessary effort behind the idea to move in any of the proposed directions. That is why the topic was basically "on hold" for over a year. I think it is valuable to include the history of this article to help readers follow how we got into the current state.

Colcon was created as a PoC to demonstrate the viability of the approach of a unified build tool layer ...

I don't think this is the case either. I have implemented build systems and build tools in the past as well as wrote the initial draft of this article describing that there is a strong need for unifying the development. The technical feasibility wasn't really a concern.

colcon was pretty much developed by myself for two reasons:

  • curiosity to learn and use new stuff (e.g. setup.cfg files), the challenge to design a complex piece of software in a highly modular and extensible way and
  • as a "side effect" improve my own workflow to build Gazebo, ROS 2 and ROS 1 which I am using in my day job more efficiently.> While it is interesting for me to see how decisions are made at OSRF, maybe this part could still just state the relevant technical facts ...

As any other company OSRF has limited resources. And with that constraint comes the difficult decision what project / part to spend them on. I think it is important to acknowledge that here to provide context to readers where there was no significant development in this area in the past year.

The discussion about the first draft was inconclusive

From my point of view that does not reflect the facts. The previous draft came up with a clear rational why it would be useful to unify the different tools. At the end of the day no party was willing to put the necessary effort behind the idea to move in any of the proposed directions. That is why the topic was basically "on hold" for over a year. I think it is valuable to include the history of this article to help readers follow how we got into the current state.

Colcon was created as a PoC to demonstrate the viability of the approach of a unified build tool layer ...

I don't think this is the case either. I have implemented build systems and build tools in the past as well as wrote the initial draft of this article describing that there is a strong need for unifying the development. The technical feasibility wasn't really a concern.

colcon was pretty much developed by myself for two reasons:

  • curiosity to learn and use new stuff (e.g. setup.cfg files), the challenge to design a complex piece of software in a highly modular and extensible way and
  • as a "side effect" to improve my own workflow to build Gazebo, ROS 2 and ROS 1 which I am using in my day job more efficiently.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe replace "As a consequence" with "Meanwhile", to reduce the risk of sounding accusatory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe replace "As a consequence" with "Meanwhile", ...

Updated in d326e11.

Therefore its feature set is closely aligned with the following requirements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we highlight here that this doesn't have usability features of catkin_tools either such as profiles (like it's been mentioned above for ament_tools)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already mentioned above and below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's my point... You added it above for ament_tools and not here while it applies to both.

The fact the selecting colcon requires that feature to be listed in the "Future" section doesn't justify not mentioning it here in my opinion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please feel free to commit any proposal you think makes it better.


## Naming

The existing build tools are all named by the build system they are supporting.
The existing build tools in ROS are all named by the build system they are supporting.
In general it should be possible for a build tool to support multiple different build systems.
Therefore a name for a build tool being derived from a single build system might mislead the users that the tool only works for that specific build system.
To avoid confusion of the user the build tool should have a different unrelated name to avoid implying an undesired correlation.
Expand All @@ -233,6 +231,10 @@ The following uses cases should be satisfied by the unified build tool.
The tool needs to be able to build ROS 1 workspaces which can already be built using `catkin_make_isolated` / `catkin_tools`.
It is up to the implementation to decide if it only supports the standard CMake workflow or also the *custom devel space concept* of `catkin`.

In ROS 2 the concept of the *devel space* has intentionally been removed.
In the future it might be feasible to provide the concept of *symlinked installs* in ROS 1 to provide a similar benefit without the downsides.
Therefore not supporting this concept in the universal build tool is considered a viable path forward.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ROS 1 or just ROS 2? If this includes ROS 1 (only thing that make sense from the text), then I don't feel that this was properly resolved.

Though I'm in favor of getting rid of the devel space in ROS 1, I think we cannot commit to doing that (and therefore not supporting it in the build tool) until we propose how to deprecate and then remove the devel space. In my opinion, It should still be a requirement that the default build tool for ROS 1 needs to support the devel space, at least until it is in the process of being removed.

Did others (other than @dirk-thomas) have a different conclusion based on our discussions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree with you points. Therefore I don't see colcon becoming the recommended tool for ROS 1 until that has been worked out.

Copy link
Member Author

@dirk-thomas dirk-thomas Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ROS 1 or just ROS 2?

colcon doesn't aim to support the concept of a devel space - so that applies for ROS 1 as well as ROS 2.

Copy link
Member

@wjwwood wjwwood Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Therefore I don't see colcon becoming the recommended tool for ROS 1 until that has been worked out.

Perhaps I'm the only one (still looking for others input here), but I feel that's an important thing to figure out now, because if the conclusion (at some later date) is that ROS 1 cannot live without the devel space and colon will never support it, I think that reality should be captured here.

If we were to later surmise that "it's unacceptable for the default ROS 1 build tool to not support devel space", then we would have a situation which is at odds with the decision we have now.

I don't suppose we have to sort it out now, but it was a surprise to me when I realized it had not been resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's summarize the "facts" first then:

  • The devel space requires ROS packages to do "special" logic (not native to CMake) to support the devel space correctly (e.g. different CMake extra files for devel and install).
  • The fact that a package might only work in one of the cases (devel vs. install) if it the code is incorrect is surprising to users (since they might only use one of the two).
  • The advantage of not copying resources can be achieved with symlinked installations which doesn't come with any of the above cons.
  • The only disadvantage of using symlink install over devel space is that it requires packages to have install rules.

Based on these we decided in ROS 2 to not support the concept of devel space. Imo the same rational applies for a new build tool in ROS 1 (since the facts haven't changed). There would be an easy transition path: to add install rules if they are not already there.

That doesn't imply that we would ever remove the devel space logic from catkin. If users would like to continue using it they are fine to do it using the existing build tools. I don't think we will ever remove those since we don't want to break existing workflows. Instead we would just recommend something different. Users just shouldn't expect active development on the not anymore recommended build tools - but they should continue to work.

Copy link
Member

@wjwwood wjwwood Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might be missing my point.

I'm not arguing for or against having the devel space or the build tool support for it.

Instead, my point is that the intended future state ought to be decided on, it sounds like it has already been, and that in the implications section should say something like "therefore the default ROS 1 build tool will not support a devel space only workspaces, i.e. the default build tool will require install rules".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @wjwwood. We need to have certainty about the intended final result.

I have no problems with the idea of ROS 1 eventually not supporting a devel space. I personally dislike the idea and much prefer ROS 2's approach to supporting a rapid development workspace.

However, the idea that ROS 1 could continue to work with both catkin and the new build tool sounds infeasible to me, if they have different requirements on the CMakeLists.txt files, which is what I think will be the case (please correct me if I'm wrong). Users of the new build tool would probably be fine, but as more and more packages support only the new build tool, those still using catkin for their work flow might find it increasingly difficult to stay that way. This seems like it would lead to friction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my point is that the intended future state ought to be decided on, it sounds like it has already been

I didn't intend to decide anything for ROS 1 in this article. The idea was to describe how a path forward could look like. A decision about ROS 1 should be made in an REP and/or discourse discussion.

the idea that ROS 1 could continue to work with both catkin and the new build tool sounds infeasible to me, if they have different requirements on the CMakeLists.txt files, which is what I think will be the case (please correct me if I'm wrong). Users of the new build tool would probably be fine, but as more and more packages support only the new build tool, those still using catkin for their work flow might find it increasingly difficult to stay that way. This seems like it would lead to friction.

I am not sure a new recommended build tool not supporting the devel space has a big impact here. As I mentioned in this comment this kind of problem already exists in ROS 1 today. Some packages do only work in the devel space and some do only work in the install space (since these packages haven't been developed with both in mind and the developers / maintainers / users only use one of the two). The choice of build tool doesn't change that. The only difference would be that recommending the new build tool without support for devel spaces will likely shift the ratio to more packages working in install space.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any data available on what the ratio is between one or the other style?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any data available on what the ratio is between one or the other style?

Not that I know of.


#### Build ROS 2 workspaces

The tool needs to be able to build ROS 2 workspaces which can already be built using `ament_tools`.
Expand All @@ -248,7 +250,7 @@ After the build a single file can be sourced / invoked to setup the environment
Invoking a build system for a package implies also setting up environment variables before the process, e.g. the `CMAKE_PREFIX_PATH`.
It should be possible for developers to manually invoke the build system for one package.
The environment variable might be partially different from the environment variables necessary to use a package after it has been built.
To make that convenient the tool should provide an easy to use mechanism to setup the development environment necessary to invoke the build system.
To make that convenient the tool should provide an easy to use mechanism to setup the development environment necessary to manually invoke the build system.

### Beyond Building

Expand All @@ -262,7 +264,7 @@ The tool aims to support a variety of build systems, use cases, and platforms.
The above mentioned ones are mainly driven by the needs in the ROS ecosystem but the tool should also be usable outside the ROS ecosystem (e.g. for Gazebo).
Therefore it should be designed in a way which enables extending its functionality.

Assuming that the tool will be implemented in Python (since that is the case for existing tools) the entry point mechanism provides a convenient way to make the software extensible.
Assuming that the tool will be implemented in Python (since that is the case for all existing ROS build tools) the entry point mechanism provides a convenient way to make the software extensible.
Extensions don't even have to be integrated into the Python package containing the core logic of the build tool but can easily be provided by additional Python packages.
This approach will not only foster a modular design and promote clear interfaces but enable external contributions without requiring them to be integrated in a single monolithic package.

Expand All @@ -289,59 +291,119 @@ The following items are possible extension points to provide custom functionalit
- setup the environment (e.g. `sh`, `bash`, `bat`)
- completion (e.g. `bash`, `Powershell`)

Assuming that the tool will be implemented in Python (since that is the case for existing tools) the entry point mechanism provides a convenient way to make the software extensible.
Extensions don't have to be integrated into the Python package containing the core logic of the build tool but can easily be provided by additional Python packages.
This approach will not only foster a modular design and promote clear interfaces but enable external contributions without requiring them to be integrated in a single monolithic package.

## Possible Approaches

In terms of flexibility neither of the existing build tools can already support the superset of features described in this article.
There are multiple different paths possible to reach the goal of a universal build tool which fall into two categories:
When the first draft of this article was written neither of the existing build tools supported the superset of features described in this article.
There were multiple different paths possible to reach the goal of a universal build tool which fall into two categories:

- One approach is to incrementally evolve one of the existing tools to satisfy the described goals.
- Another approach would be to start "from scratch".

Since then the new project `colcon` has been developed which covers most of the enumerated requirements and represents the second category.

### Evolve catkin_make, catkin_make_isolated, or ament_tools

Since neither of these three build tools has the feature richness of `catkin_tools` it is considered strictly less useful to starting building upon one of these build tools.
Therefore neither of these are being considered as a foundation for a universal build tool.

### Evolve catkin_tools

Since `catkin_tools` is in many aspects the most complete build tool it should be the one being evolved.
Since `catkin_tools` is in many aspects the most complete ROS build tool it should be the one being evolved.
While `ament_tools` has a few features `catkin_tools` currently lacks (e.g. plain CMake support without a manifest, Windows support) the feature richness of `catkin_tools` makes it a better starting point.

The following items are highlighting some of the necessary efforts (not a complete list):
### Start "from scratch" / colcon

Since the first draft of this article the `colcon` project has been developed with the goals and requirements of a universal build tool in mind.
In its current form it is already able to build ROS 1 workspaces, ROS 2 workspaces, as well as Gazebo including its ignition dependencies.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that colcon cannot build workspaces with a mix of ros1 and ros2 packages, since this was a limitation discussed originally. I that true? I did not see it mentioned in the changes or the colcon manuals. Might just help managing expectations to state it explicitly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that colcon cannot build workspaces with a mix of ros1 and ros2 packages, since this was a limitation discussed originally. I that true?

I don't think that is the case. colcon doesn't mind what kind of packages it processes in a workspace. Technically I don't see anything within the build tool prohibiting to process a heterogeneous workspace.

But there are other things affecting how useful or how feasible a mixed workspace is. Commonly ROS packages depend on other ROS packages by name, find_package them, use their API etc. all of that needs to be "compatible" too in order to successfully build a heterogeneous workspace.

For a simple example: a library exported by a catkin package could transparently be used and linked in an ament_cmake package. That is more related to the compatibility between both CMake packages than to the build tool. Please feel free to give that use case a try.> I assume that colcon cannot build workspaces with a mix of ros1 and ros2 packages, since this was a limitation discussed originally. I that true?

I don't think that is the case. colcon doesn't mind what kind of packages it processes in a workspace. Technically I don't see anything within the build tool prohibiting to do so.

But there are other things affecting how useful or how feasible a mixed workspace is. Commonly ROS package depend on other ROS packages by name, find_package them, use their API etc. all of that needs to be "compatible" too in order to successfully build a heterogeneous workspace.

For a simple example: a library exported by a catkin package could transparently be used and linked in an ament_cmake package. That is more related to the compatibility between both CMake packages then to the build tool. Please feel free to give that use case a try.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a sentence here to highlight the state of colcon regarding support of heterogeneous workspaces?

It uses Python 3.5+ and targets all platforms supported by ROS: Linux, macOS, and Windows.

Since it hasn't been used by many people yet more advanced features like cross compilation, `DESTDIR`, etc. hasn't been tested (and will therefore likely not work yet).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt try cross-compilation since my original review but last time I tried it seemed to work as expected

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we have exercised this I think mentioning this is the "defensive" approach.


## Decision process

For the decision process we are only considering the following two options based on the rational described above:

A. Use `catkin_tools` as a starting point
B. Use `colcon` as a starting point

We acknowledge that if this topic would have been addressed earlier that some of the duplicate effort could have been avoided.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What duplication of effort could have been avoided by making a decision earlier?

It was always possible (whether officially or in spare time) to either build something new (duplicating effort) or contribute to existing software, or a fork of existing software (avoiding some redundant work).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my point of view no involved party wanted to commit resources on this topic for a long time. If that would have been different everyone involved could have influenced the direction of the development. Since that was not the case I spend my time on colcon because I saw the advantages of starting from scratch. I decided not to contribute to catkin_tools since I didn't consider the architecture of the code base to be a good foundation for the goals (the reference API for output handling in the article is just one example). And refactoring the whole code base wasn't in the scope of time I was willing to spend on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My intention was not to criticize the approach, though I do think iterating on catkin_tools would have been a better end result, instead I was just curious how you thought making the decision earlier would have saved code duplication.

When the work towards a universal build tool was suspended over a year ago it was a conscious decision based on available resources.
Nevertheless we have to move forward with a decision in order to avoid further uncertainty and duplication.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoiding uncertainty, I agree with, however.


Both of the considered options have unique and valuable features and there are good arguments to build our future development on either of the two tools.
Since both are written in Python either of the two tools could be "transformed" to cover the pros of the other one.
So the two important criteria for the decision are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the only criteria? If not, how did we down-select to these being the most important criteria?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo the amount of time necessary to reach the stated goal is of highest importance. Simply because we are already very thin on resources and progress on feature development is rather slow. So any extra time spend on other items like this will slow our progress down. The second point is the quality of the end result since that will immediately effect the effort necessary to maintain and develop the software in the future. Therefore these are the "two important criteria".

There are certainly more but I didn't enumerate them here. Please feel free to add more from our internal documentation.


- the effort it takes to so (in the short term as well as in the long term) and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence doesn't make sense to me, maybe you mean to do, but not sure?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 783e1ae.

- the difference of the resulting code base after the "transformation" is completed.

### Immediate goals

A ROS 2 developer currently builds a steadily growing workspace with ROS 2 packages.
The same is happening in the monolithic Jenkins jobs on [ci.ros2.org](https://ci.ros2.org) (with the advantage to test changes across repositories easily).
Therefore features to easily filter the packages which need to be build are eagerly awaited to improve the development process.

For the last ROS 2 release *Ardent* the buildfarm [build.ros.org](http://build.ros2.org) only provides jobs to generate Debian packages.
Neither *devel* jobs or *pull request* jobs are available nor is it supported to build a local *prerelease*.
For the coming ROS 2 release *Bouncy* these job types should be available to support maintainers.

In ROS 2 *Bouncy* the univeral build tool will be the only supported option and `ament_tools` will be archived.

#### Necessary work

For either option **A)** or **B)** the follow items would need to be addressed:

- The jobs and scripts on *ci.ros2.org* need to be updated to invoke the universal build tool instead of `ament_tools`.
- The `ros_buildfarm` package needs to be updated to invoke the universal build tool instead of `catkin_make_isolated`.
The ROS 2 buildfarm would use this modification for the upcoming ROS 2 *Bouncy* release.
The ROS 1 buildfarm could use the same modification in the future.

For option **A)** the follow items would need to be addressed:

- Support for setup files generated by `ament_cmake`.
- Support additional packages types: plain Python packages, CMake packages without a manifest.
- Support for Windows using `.bat` files.
- Support for the package manifest format version 3.

- Refactor the software architecture of the existing code base to support the flexibility sketched by the extension points listed above.
For option **B)** the follow items would need to be addressed.

- Move `catkin` specific concepts out of the core of the build tool into a catkin specific extension (e.g. manifest format, *devel space*).
- Address user feedback when the tool is being used by a broader audience.

- Support for ROS 2 which includes:
### Future

- Support for Python 3 and Windows.
- Support for pure Python packages as well as packages without an in-source manifest file.
- Environment setup of `ament` packages
The long term goal is that the universal build tool will be used in ROS 1, in ROS 2 as well as other non-ROS projects.
There is currently no time line when the tool will be used on the ROS 1 build or be recommended to ROS 1 users.
This solely depends on the resources available for ROS 1.

- Rename the tool to use a name unrelated to one build system.
Beside that for both options there is follow up work beyond the immediate goals.
The following enumerates a few of them but is by no means exhaustive:

- Investigate if a feature like continued support of the *devel space* is feasible since it doesn't apply to other build system and might be complicated to separate without sacrificing usability.
For option **A)** the follow items should be considered:

### Start "from scratch"
- Support for Python packages using a `setup.cfg` file.
- Support for `PowerShell` to work around length limitations for environment variable on Windows.
- Support to pass package specific argument.
- Remove support for the *devel space* concept in ROS 1.
- Update code base to Python 3.5+.
- Refactor code base to reduce coupling (e.g. separate [API](https://github.com/catkin/catkin_tools/blob/2cae17f8f32b0193384d2c7734afee1c60c4add2/catkin_tools/execution/controllers.py#L183-L205) for output handling).
- Additional functionality to build Gazebo including its dependencies.

Another approach is to implement the necessary software architecture to enable the desired flexibility and modularity "from scratch".
Then fill in the features step-by-step by porting existing building blocks from the existing solutions.
Some items to highlight the necessary efforts (not a complete list):
For option **B)** the follow items should be considered:

- Create the software architecture to support the flexibility sketched by the extension points listed above which will be easier "from scratch" than for an existing code base.
- Support cross compilation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember from offline discussion that there was no feature to be added here but just a lack of testing.
I recommend splitting the "missing features" from the "untested features" as it gives a better idea of how much work is still needed.

As a data point I cross-compiled ardent following these instructions with colcon and it built successfully. I didnt have a board around to do runtime testing though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for trying it. I removed the bullet for now (3b1925a) since there seems to be no problem. If it turns out that there is still a problem it can be addressed as a bug fix.

- Support `DESTDIR`.
- Support a feature similar to the `profile` verb of `catkin_tools`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More things:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please feel free to add them to the article.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for ref: #169.


- Port / reimplement many of the features existing in the other build tools.
It will take a non trivial amount of time to reach the feature level of e.g. `catkin_tools`
## Decision

- Thorough test the functionality and write documentation for developers as well as users.
Based on the above information we made the not easy decision to pick `colcon` as the universal build tool.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is "we"?


## Proposal
To elaborate on the rational one significant advantage of `colcon` is that it is ready to be deployed for ROS 2 right now and it covers our current use cases.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... on the rationale ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2e9804e.

Another argument leaning towards `colcon` is the expected little effort to provide devel / PR / prerelease jobs on build.ros2.org across all targeted platforms for the upcoming *Bouncy* release.
While some additional feature and usability options are still missing they can be added in the future whenever there is time and/or demand for them.

The decision of which approach should be selected is deferred at the moment since nobody is likely able to spend any time on this in the foreseeable future.
It could also be considered an implementation detail - as long as the described goals are reached it doesn't matter how the unified build tool was getting there.
The necessary up front development effort for `catkin_tools` to achieve the goals described for *Bouncy* would distract the ROS 2 team from spending their time on feature development and bug fixing of ROS 2 itself.

*Hopefully to be continued in the future...*
While the short term advantages are certainly a main reason why we decided in favor of `colcon` they are not the only ones.
The cleaner architecture, modularity and extensibility as well as Python 3.5 code base will be valuable long term benefits when developing this tool in the future.
The separation of the build tool name from the supported build systems as well as the separation from being a "ROS-only" tool will hopefully also help users to understand the difference and attract new users and potential contributors.