Skip to content

Fix merge imports based on semver#2492

Closed
fibonacci1729 wants to merge 1 commit intobytecodealliance:mainfrom
fibonacci1729:merge-fix
Closed

Fix merge imports based on semver#2492
fibonacci1729 wants to merge 1 commit intobytecodealliance:mainfrom
fibonacci1729:merge-fix

Conversation

@fibonacci1729
Copy link
Copy Markdown
Contributor

@fibonacci1729 fibonacci1729 commented Apr 16, 2026

#2451 introduced topologically_sort_interfaces and correctly calls it at the end of Resolve::merge_packages after modifying interface dependencies. However, merge_world_imports_based_on_semver was not updated with the same fix.

merge_world_imports_based_on_semver calls update_interface_dep_of_type to rewire type aliases from older semver-compatible interfaces to their newer replacements. This changes the dependency edges in the interface graph: an interface A that previously pointed to B_old (positioned before A in the arena) may now point to B_new (positioned after A). This violates the topological ordering invariant that assert_topologically_sorted checks.

The merge path already handled this by calling self.topologically_sort_interfaces(...) after modifying type references, but the semver deduplication path was missed.

Signed-off-by: Brian Hardock <brian.hardock@fermyon.com>
@fibonacci1729 fibonacci1729 requested a review from a team as a code owner April 16, 2026 17:35
@fibonacci1729 fibonacci1729 requested review from dicej and removed request for a team April 16, 2026 17:35
@dicej
Copy link
Copy Markdown
Collaborator

dicej commented Apr 16, 2026

Looks reasonable, but CI is unhappy.

@fibonacci1729
Copy link
Copy Markdown
Contributor Author

Closing this to further investigate. #2493

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