Is there a way to build packages "up-to" by passing a directory path?

asked 2021-01-20 06:40:24 -0500

Dben gravatar image

Let's say I have a workspace with:

image description

And i want to only colcon build my-package-to-compile and all its dependencies. This is a simple example, but I have a workspace with over 50 packages/meta-packages. Now, I list the packages that are no in the deps directory and use --packages-up-to with the list i created. I am testing now with ros1 by the way.

Is there a way to do that without this "hack"?

Thanks

edit retag flag offensive close merge delete

Comments

Just to clarify: You want to build a set of N packages including its dependencies out of a workspace with M packages, where you put some dependencies (in whatever way you identify those) into a deps subdirectory containing another L packages?

mgruhler gravatar image mgruhler  ( 2021-01-20 13:59:38 -0500 )edit

Yes exactly, thanks. I put all the dependencies in one directory and the core packages in another. Now I'd like to tell colcon to build all core ones and dependencies and ignore all non needed dependencies. Now, I'm doing a "hack" with rospack list and depends to get exactly what I need but it's not clean

Dben gravatar image Dben  ( 2021-01-20 16:34:26 -0500 )edit

I don't think (but I don't know) if there is something like this available. This would be a complete new feature, I guess.

If you always build ALL core packages, and all dependencies (but no other packages) are in the deps directory, I don't think there is a difference between calling colcon without a package or with all core packages. Packages that haven't changed will not be built anyways (even though CMake configuration might run).

If the list of packages you want to build is not changing, or not changing a lot, I'd actually go for a bash alias..

Maybe, to avoid an xy-problem here, you could clarify a bit more why you need to do it this way? I.e., what do you expect to gain from this approach?

mgruhler gravatar image mgruhler  ( 2021-01-21 04:56:50 -0500 )edit

Thanks for the link. I didn't know there was a name for this! The end goal is to create different bundles with colcon bundle, in jenkins and save time. Each of my 15 repositories contains one metapackage and between 2 and 10 packages, so if one depends on another which depends on another... I can end up with a workspace of 30 packages easily, but the packages i bundle only can require 5 for example. Since i need to bundle around 10 packages (now, it will be more later on), the resulting time difference is very high

Dben gravatar image Dben  ( 2021-01-22 01:36:02 -0500 )edit

But how does the approach of putting dependencies (I read this now as repos) in a sub-directory solve your issues? This means that you basically have a configuration somehow where you need to put what. I.e. you put some repos in the workspace root, some in the deps folder. But when you have that config, can't you just directly take this configuration for creating the build?

mgruhler gravatar image mgruhler  ( 2021-01-22 04:34:09 -0500 )edit

Thanks, I see what you mean, I will try to simplify over the weekend and come back.

Dben gravatar image Dben  ( 2021-01-22 05:11:18 -0500 )edit