Skip to content

fix: respect run dependencies on sibling outputs for build ordering - #2488

Open
esteve wants to merge 2 commits into
prefix-dev:mainfrom
esteve:fix/topological-sort-plain-run-deps
Open

fix: respect run dependencies on sibling outputs for build ordering#2488
esteve wants to merge 2 commits into
prefix-dev:mainfrom
esteve:fix/topological-sort-plain-run-deps

Conversation

@esteve

@esteve esteve commented May 11, 2026

Copy link
Copy Markdown

This PR fixes a regression in the topological sort that was introduced during the v0.58.0 refactor. When multiple recipes are built together, the dependency graph used for ordering builds only considered pin_subpackage references from run dependencies, but ignored plain run: specs. This caused solver failures when a package needed a plain runtime dependency that hadn't been built yet.

The fix replaces extract_dependency_names with extract_dependency_names_with_sibling_context, which also collects plain run/run_constraints dependencies whose names match other outputs in the build set.

This issue is causing ROS Humble to fail a full rebuild for the RoboStack project RoboStack/ros-humble#400 (ros-humble-uncrustify-vendor which is a plain run dependency was scheduled to build after its consumer ros-humble-ament-uncrustify), with this fix I was able to do a full rebuild of ROS Humble.

I found this fix as part of an existing Claude session 780ce80, I don't know what's the policy regarding AI-generated contributions, so I kept the author (Claude) and removed the skip filtering test as it's not part of this fix, but part of 8f5cb03

@esteve
esteve force-pushed the fix/topological-sort-plain-run-deps branch from 0e8dbf4 to c653513 Compare May 11, 2026 08:13
esteve added a commit to esteve/robostack-ros-humble that referenced this pull request May 12, 2026
…ev/rattler-build#2488

Signed-off-by: Esteve Fernandez <esteve.fernandez@bonsairobotics.ai>

@pb01ka pb01ka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall I found the fix correct and the tests also seem to be meaningful.

The main actionable item from my end is removing the Option<> wrapper from sibling_names since the other path is never executed as of today. Hence, it would make the contract clearer and removes a branch that can never execute.

Comment thread crates/rattler_build_recipe/src/variant_render.rs Outdated
Signed-off-by: Esteve Fernandez <esteve@apache.org>

@pb01ka pb01ka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Submitting approval.

@wolfv I think this can be merged.

Thank you.

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