Skip to content

fix the build dependencies to include recursive run dependencies from packages within the workspace#310

Merged
dirk-thomas merged 1 commit into
masterfrom
fix_build_deps
Jul 14, 2016
Merged

fix the build dependencies to include recursive run dependencies from packages within the workspace#310
dirk-thomas merged 1 commit into
masterfrom
fix_build_deps

Conversation

@dirk-thomas
Copy link
Copy Markdown
Member

Reported in ros-simulation/gazebo_ros_pkgs#473 (comment)

I ran a test job with the branch of the pull request and gazebo was added as a build dependency as desired.

@dirk-thomas dirk-thomas self-assigned this Jul 14, 2016
run_depends_in_pkgs = set([d.name for d in depends if d.name in other_pkgs_by_names])
while run_depends_in_pkgs:
# pick first element from sorted order to ensure deterministic results
pkg_name = sorted(run_depends_in_pkgs).pop(0)
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 would be more efficient to call

run_depends_in_pkgs.sort()
run_depends_in_pkgs.pop(0)

And then you can get rid of run_depends_in_pkgs.remove(pkg_name)

Sorting an already sorted list is more efficient and this will avoid the copy as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The variable is currently a set in order to avoid duplicates but a set can't be sorted. I am not sure if converting the data structure to a list (which can be sorted) makes sense since then it will require manual logic to deduplicate.

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.

Nevermind, I was thinking it was a list. The logic to deduplicate is definitely worth avoiding at the cost of a sort/copy.

@tfoote
Copy link
Copy Markdown
Member

tfoote commented Jul 14, 2016

One possible optimization but otherwise looks good to me.

Seeing this in the script kind of makes me wonder if there might be a more centralized location for this sort of logic that might be shareable between the different scripts. But it is a kind of application specific sorting so might not be worth trying to centralize.

@dirk-thomas dirk-thomas merged commit 03744ae into master Jul 14, 2016
@dirk-thomas dirk-thomas deleted the fix_build_deps branch July 14, 2016 17:54
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.

2 participants