Skip to content

Consider not accessing run/exec dependencies during colcon build #707

Description

@clalancette

I've recently been doing some work to investigate colcon behavior, and I found a somewhat non-intuitive result.

In particular, if pkg_a has an <exec_depend> on pkg_b, which has a <build_export_depend> on pkg_c, then building pkg_a accesses the environment for both pkg_b and pkg_c. But that seems unnecessary; since pkg_a only has an exec_depend, it shouldn't need to access either of those dependencies at build-time. You can see an example of this in action at https://github.com/clalancette/colcon_exec_ws .

After talking to @cottsay a bit about this, this is basically how colcon does it at present. All dependencies are collapsed into a build, run, or test dependency: https://github.com/colcon/colcon-ros/blob/65ac2ec65c5704aa9a4d9fffdd20de4389a45e1b/colcon_ros/package_identification/ros.py#L117-L122 . And all of these dependencies are accessed by colcon at present.

In the future we could consider splitting these out to be more fine-grained, which would fix this particular issue and possibly make builds a bit faster. But it would probably cause a lot of problems in the ecosystem with incorrect dependencies, so it would have to be rolled out rather slowly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions