ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

rosmake with stack name argument

asked 2012-11-26 06:46:48 -0600

I wonder if it is intended behavior of the rosmake utility to include all packages in dependent stacks (stack A) in the list of packages to be built when invoked with a stack name (stack B) as argument although these packages are not required to build the packages in stack B.

Example:

stack A
  |- package A1
  |- package A2
stack B (depends on stack A)
  |- package B1 (depends on package A1)

Stack B depends on stack A because package B1 depends on A1. Note that package B1 does not depend on A2.

If you run rosmake for package B1 only, packages B1 and A1 will be built, which is what I would expect:

$ rosmake B1
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are:
['B1']
[ rosmake ] Logging to directory /home/meyer/.ros/rosmake/rosmake_output-20121126-192457
[ rosmake ] Expanded args ['B1'] to:
['B1']                                                             
[rosmake-0] Starting >>> A1 [ make ]
[rosmake-0] Finished <<< A1 [PASS] [ 1.80 seconds ]
[rosmake-0] Starting >>> B1 [ make ]
[rosmake-0] Finished <<< B1 [PASS] [ 1.35 seconds ]
[ rosmake ] Results:
[ rosmake ] Built 2 packages with 0 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/meyer/.ros/rosmake/rosmake_output-20121126-192457

But if you run rosmake with the stack B as argument package A2 will also be built:

$ rosmake B
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['B']
[ rosmake ] Logging to directory /home/meyer/.ros/rosmake/rosmake_output-20121126-192509
[ rosmake ] Expanded args ['B'] to:
['B1']
[rosmake-0] Starting >>> A1 [ make ]
[rosmake-1] Starting >>> A2 [ make ]
[rosmake-0] Finished <<< A1 [PASS] [ 1.00 seconds ]
[rosmake-0] Starting >>> B1 [ make ]
[rosmake-1] Finished <<< A2 [PASS] [ 1.57 seconds ]
[rosmake-0] Finished <<< B1 [PASS] [ 1.01 seconds ]
[ rosmake ] Results:
[ rosmake ] Built 3 packages with 0 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/meyer/.ros/rosmake/rosmake_output-20121126-192509

If stack B does not declare the dependency to stack A in its stack.xml, package A2 will not be built.

The example has been tested with the current ros-fuerte-ros release (1.16.1.2ubuntu7).

edit retag flag offensive close merge delete

Comments

To clarify a bit further: The essence of the question is the semantics of rosmake B: Is it a)build all packages in B and all stacks that B depends on (recursively) or b)build all packages in B and all packages that packages in stack B depend on? a) is the current behavior, b) is what I would expect.

Johannes Meyer gravatar image Johannes Meyer  ( 2012-11-26 11:55:30 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2013-01-23 11:01:03 -0600

Dirk Thomas gravatar image

This issue has been fixed (https://code.ros.org/trac/ros/ticket/4068) and will be released in the next patch release of ros: 1.9.41.

The behavior is the following: if a stack is specified on the cli which does not contain any packages rosmake will add all stack which this stack depends on and therefore their packages. For non-empty stacks it will not consider any stack dependencies.

edit flag offensive delete link more
3

answered 2012-11-26 22:56:13 -0600

KruseT gravatar image

Probably the behavior of rosmake could be changed such that rosmake B is translated to rosmake B1 (In general all packages in the given stack). The stack-to-stack dependency should maybe only be used for packaging, not building.

Given that stacks are defined as an atomic unit of release, not an atomic unit of build, that would make sense.

So you can always raise a ticket and see what the rosmake maintainers will have to say about it.

Which package goes into which stack should also be a releasing decision.

One way to think about it is: If one day there was a debian package for stack B, and users apt-get install it, should this also automatically install A2 (and thus also all of the dependencies of A2)?

edit flag offensive delete link more

Comments

Why change the semantics of rosmake so late in its life-cycle?

joq gravatar image joq  ( 2012-11-27 02:09:33 -0600 )edit
1

I filed a ticket for rosmake as suggested by KruseT: https://code.ros.org/trac/ros/ticket/4068. Let's see what the maintainers think is the "right" semantics.

Johannes Meyer gravatar image Johannes Meyer  ( 2012-11-28 05:13:45 -0600 )edit
2

answered 2012-11-26 08:53:42 -0600

joq gravatar image

That seems like reasonable behavior to me.

What did you expect?

edit flag offensive delete link more

Comments

Yes, I agree. But this behavior caused some problems in the past if there are packages in stack A that have dependencies to packages the user who wants to compile all packages in stack B has not installed. In this case, rosmake B would fail without reason.

Johannes Meyer gravatar image Johannes Meyer  ( 2012-11-26 09:06:59 -0600 )edit
1

If A pulls in large dependencies that nothing in B requires, then there is something wrong with the packaging of A. It should probably be divided into smaller stacks.

joq gravatar image joq  ( 2012-11-26 12:30:33 -0600 )edit

Okay, that would probably be possible. One typical use case is when A1 contains message definitions and A2 uses some libraries (that the user of stack B has not installed) and publishes A1 messages, which B1 wants to subscribe to. Logically A1 and A2 belong together and not in separate stacks...

Johannes Meyer gravatar image Johannes Meyer  ( 2012-11-26 13:35:37 -0600 )edit
2

In that example, releasing A1 as a separate unary stack would be the preferred solution. Packaging the messages separately almost always significantly simplifies the dependency graph.

joq gravatar image joq  ( 2012-11-26 14:56:42 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-11-26 06:46:48 -0600

Seen: 394 times

Last updated: Jan 23 '13