Skip to content

text edits#119

Closed
tkruse wants to merge 17 commits intoros2:build_toolfrom
tkruse:build_tool
Closed

text edits#119
tkruse wants to merge 17 commits intoros2:build_toolfrom
tkruse:build_tool

Conversation

@tkruse
Copy link
Copy Markdown

@tkruse tkruse commented Mar 12, 2017

Mostly suggestions to keep focus on change, and add more context. None of it is essential, I was writing while reading.

I added package-managers for larger audiences.

I started structuring of essential and non-essential features.

Feel free to cherry pick what you like and close PR without merge without further discussion.

Some comments independent from my PR (but less chat in the main PR)

  • The goal is not motivated yet. I hint at issues with the current situation, but without explaining those issues, it is difficult to make a decision solving them.
  • I noticed rosbuild was not mentioned much so far, nor tools relying on the ROS_PACKAGE_PATH. Not sure if that is important for the discussion
  • while packaging is out of the scope for the tool, I believe the package manifest provides packaging data, might be worth mentioning (Also because of catkin_simple)
  • it might be helpful to compare the "anatomy" of catkin and ament files, to see the problems in migrating from one to the other
  • Devel_spaces not mentioned yet
  • I think catkin_isolated and catkin_auto can also build non-catkin cmake packages, no? The current text suggests otherwise

The realistic alternative approaches should be more detailed.
So far I see:

  • keeping catkin packages same vs. requiring migration
  • evolving catkin_tools vs. evolving ament_tools ('from scratch' is equivalent to one of those)

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 13, 2017

More things I notice missing in goals, maybe because they seem too obvious:

  • Cross-compilation support
  • Cross plattform compatibility
  • cmake support as a constraint

Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

The goal is not motivated yet. I hint at issues with the current situation, but without explaining those issues, it is difficult to make a decision solving them.

The goal is to consolidate the effort from the various build tools, avoid duplicate work and create a single tool which covers all the current use cases (and hopefully more).

I noticed rosbuild was not mentioned much so far, nor tools relying on the ROS_PACKAGE_PATH. Not sure if that is important for the discussion

This is a good example why the unified build tool needs to be very modular. The ROS_PACKAGE_PATH is a ROS specific concept and therefore not relevant in non-ROS use cases. Therefore the core part of the unified build tool should not know about this. Only a ROS specific plugin should introduce the concept of that environment variable.

it might be helpful to compare the "anatomy" of catkin and ament files, to see the problems in migrating from one to the other

Again, this is related to the build system and imo out of scope for this build tool article. From the build tools point of view it treats both ROS build system as separate and doesn't care how they operate (and if they are similar or how they are different).

Devel_spaces not mentioned yet

The devel space is a build system concept (only in catkin). The core of the unified build tool therefore doesn't care about it. The catkin specific extension might or might not expose that feature - that is up to the implementation to decide.

keeping catkin packages same vs. requiring migration

The tool only decides how the build systems of multiple packages are being invoked in the right order. There is conceptionally nothing to migrate.

evolving catkin_tools vs. evolving ament_tools ('from scratch' is equivalent to one of those)

Trying to refactoring an existing code base of significant size to a more modular architecture is a big effort. Designing a modular architecture from scratch with the experience and knowledge about the existing systems and then porting over existing features is very different. Therefore I don't agree with your statement. Which one to choose is a different question 😉

Cross-compilation support

This boils down to being in the realm of the build system again. Consider the build tool only a fancy "command line invocation improver". It doesn't do anything for cross-compilation which the build system can't do.

Cross plattform compatibility, cmake support as a constraint

The universal build tool needs to cover all use cases the current build tools already cover, that includes but is not limited to:

  • Build catkin packages with Python 2 on Linux and OS X
  • Build ament packages with Python 3 on Linux, OS X and Windows
  • Support processing packages in parallel
  • Support packages without a manifest file (e.g. eProsima's FastRTPS)
  • Provide the usability of catkin_tools with config and profile
  • many many more

The "manual" approach to build a set of packages consists of building all packages in their topological order one by one.
For each package the documentation usually describes what the dependencies are, how to setup the environment to build the package as well as how to setup the environment afterwards to use the package.
From an efficiency point of view that manual process does not scale well.
Today, the ROS1 ecosystem has the deprecated rosbuild and the catkin_make build systems for this purpose.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sentence seem incomplete. Should there be something between "the ROS1 ecosystem has the deprecated rosbuild and" and "the catkin_make build systems for this purpose"?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No, the sentence should be complete. It is equivalent to: The ros1 ecosystem has 2 things for this purpose. 1. The deprecated rosbuild build system. 2. The catkin cmake build system.

This article describes the steps from the current build tools used in the ROS ecosystem to a single universal build tool which automates the process and works for various different use cases.
For historical reasons those buildsystems are incompatible with each other, which causes diverse issues in the present.

This article describes the steps from the current build tools used in the ROS ecosystem to a single universal build tool.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this comes from a misunderstanding of the difference of build tool and build system. The fact that ROS 1 and ROS 2 use different build systems is described in another article (http://design.ros2.org/articles/ament.html). It provides the rational why the CMake API as well as the feature set is different.

The "univeral" build tool described in this article will no change any of that. The goal of the universal build tool is solely to reduce duplication of efforts across the various existing build tools and aim to even support use cases beyond pure ROS applications.

For each package the documentation usually describes what the dependencies are, how to setup the environment to build the package as well as how to setup the environment afterwards to use the package.
From an efficiency point of view that manual process does not scale well.
Today, the ROS1 ecosystem has the deprecated rosbuild and the catkin_make build systems for this purpose.
The ROS2 ecosystem has the ament_tools build system.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ament_tools is a build tool - not a build system. Distinguishing these two is crucial for this article to make clear what the scope is.

* ROS 2 packages
* other software sources when sufficient meta information is externally provided.

The last point allows to build non-ROS dependencies of ROS packages (e.g. Gazebo including its dependencies).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To clarify: this does not imply that you can or can not mix ROS 1 and ROS 2 packages within the same workspace. Supporting that is only related to the build system.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Clarifying it in the document would be good. I had no idea.

Examples are Gnu Make, cmake, python setuptools.

A build tool schedules and invokes the build systems for separate source trees (packages) in topological order of dependency.
Example are rosbuild, catkin_make, ament.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would suggest using the name ament_tools here to not confuse this with ament_cmake.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

changed

It determines the dependency graph and invokes the package specific build tool of each package in topological order.
The build tool itself should know as little as possible about the build system used for a specific package.
Just enough in order to know how to setup the environment for it, invoke the build, and setup the environment to use the built package.
A build tool defines a manifest format for packages to follow to define the invocation of the respective build tool, and the dependencies to other packages.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I disagree that a build tool must be tighly coupled to a manifest format. A build tool needs the information which can e.g. be provided by a manifest file like the package.xml files in ROS. But that is not the only possible source. It should be possible to obtain the necessary information from any arbitrary source, e.g. an out-of-source configuration file (in whatever format you like), or like rosdep pull the information from a URL.

The tight coupling of the current build tools to the ROS manifest is one big reason why they can't be used in application outside the ROS ecosystem (e.g. Gazebo).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Is it a goal not to depend on any fixed manifest format? Then that would belong in the goals section (or somewhere else in the document, anyway)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed my change, original text changed changed upstream


The functionality to setup these environment variables can be provided by either the build tool or the build system.
In the latter case the build tool only needs to know how the build system exposes the environment setup in order to reuse it.
The build tool make it easy to extend the environment to run code from installed packages, or to build other packages on top of installed ones.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the edit looses an important point of the previous state: either the build tool or the build system can provide significant parts of this environment setup. And it describes the benefit if most of that is performed by the build system rather than the build tool.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

So it would be a "nice-to-have" feature to extract the responsibility for the environment from the build-tool? If so it should be kept, could be marked more explicitly as a possible goal.
I removed it because it looked like a technical remark, not something related to a goal.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

restored original text


### rosbuild

Rosbuild was the first build system for ROS, it was based on Makefiles.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rosbuild is both a build system as well as a build tool.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

rephrased

@wjwwood
Copy link
Copy Markdown
Member

wjwwood commented Mar 13, 2017

The devel space is a build system concept (only in catkin). The core of the unified build tool therefore doesn't care about it. The catkin specific extension might or might not expose that feature - that is up to the implementation to decide.

It doesn't have to be in the requirements or goals, but a proposal for what we should do and how that fails to address the devel space concept in catkin would be incomplete in my opinion.

Cross-compilation support
This boils down to being in the realm of the build system again. Consider the build tool only a fancy "command line invocation improver". It doesn't do anything for cross-compilation which the build system can't do.

It still may need to be addressed in some way by the tool. Especially if the tool has to connect two different build systems differently in the context of a cross-compile. You can hand wave it away as "should be in a plugin", but again that can be absent from the goals and requirements, but probably ought to be addressed in a proposal, even if just to say "it should not require anything extra out of the tool because ...".

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 16, 2017

Regarding all buildsystem-specific things: I believe they should be mentioned in the document exactly to make other people know why the goal is not simply to create a unified build-tool instead. The reason might be obvious to you, but others will not see this easily.

I am not sure if I should try editing according to the comments, or if this was too far off the mark anyway. Please advise. Close this PR without further comments if it served it's purpose in your eyes.

@dirk-thomas
Copy link
Copy Markdown
Member

I am not sure if I should try editing according to the comments, or if this was too far off the mark anyway. Please advise

I will leave this up to you. If you would like to update the PR with the goal to get it merged as a whole that is fine by me. Otherwise I can go through the patch and cherry pick the changes which are good as is into the main PR.

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 16, 2017

I might find time on this weekend.

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 18, 2017

rebased, added commit, squashed one commit for restoring original text

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 18, 2017

Added more commits, mostly tidying up the requirements section

Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

In general please use the same spelling / case for names like "ROS 1", "ROS 2", "CMake", Python, etc.

I am not sure how to proceed with this PR. Every iteration other things are added / changed / moved which makes it very difficult to iterate on this. I am open for suggestions how this should be reviewed and merged (either as a whole or in smaller pieces).

The rosbuild tool enabled this workflow first and was a critical factor in the success of ROS.

The "manual" approach to build a set of packages consists of building all packages in their topological order one by one.
For each package the documentation usually describes what the dependencies are, how to setup the environment to build the package as well as how to setup the environment afterwards to use the package.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This important information what is involved is lost in the modification.

The ROS1 ecosystem has catkin (and the deprecated rosbuild) for this purpose.
The ROS2 ecosystem has ament.

Both catkin and ament toolsets have 2 conceptually separate parts, a build tool part that deals with a single package at a time, and a build system part that deals with invoking build tools in the right order.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

a build system part that deals with invoking build tools

This seems to be swapped.

In the ROS ecosystem [bloom](http://wiki.ros.org/bloom) is used to generate the required metadata and then platform dependent tools like `dpkg-buildpackage` build binary packages.

## Build Tool vs. Build System
## Build Tool vs. Build System vs. Package manager
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this article isn't about package managers I don't see why this should be added here. Maybe move it to the "Out of scope" section instead.


The build system on the other hand operates on a single package.
In the case a package uses e.g. `CMake` the responsibility of the tool comes down to invoke the common steps `cmake`, `make`, `make install` for this package.
As another example for a package using `Autotools` the steps could look like `configure`, `make`, `make install`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The example steps for invoking these build systems is lost in the modification.


The tool invokes CMake only a single time and uses CMake's `add_subdirectory` function to process all packages in a single context.

The tool uses CMake's `include` function to process all packages in a single cmake context.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sentence directly contradicts the previous one.

### catkin_tools

[catkin_tools](https://catkin-tools.readthedocs.io/) is provided by a standalone Python package used to build ROS 1 packages.
[catkin_tools](https://catkin-tools.readthedocs.io/) is provided by a standalone Python package used to build catkin packages.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the statement that it builds ROS 1 packages is more accurate since it also supports plain CMake packages.

Removing such restrictions will be an ongoing process.

### Software Criteria
#### Build Environment Setup
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not an individual feature but a strict requirement in order to build package automatically on-top of each other. Therefore I don't think it should be moved that far down.

@tkruse
Copy link
Copy Markdown
Author

tkruse commented Mar 23, 2017

Since I suggest large changes, but those are mostly about style, I would be okay with closing this PR and you cherry-pick whatever you like (which might be nothing). This is quicker than talking back and forth.

dirk-thomas added a commit that referenced this pull request Mar 23, 2017
@dirk-thomas
Copy link
Copy Markdown
Member

I tried to integrate some of the changes and feedback from this. Please see a92be6e I will close this PR. Please make further suggestions and contributions in a separate PR.

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