Fix WIT extractor emitting wrong interface when duplicated name - #3716
Merged
itowlson merged 1 commit intoSep 15, 2026
Conversation
itowlson
force-pushed
the
extract-deps-fix-dep-imports-and-exports-same-named-itf
branch
from
September 15, 2026 01:23
64da148 to
dc5d818
Compare
|
@itowlson looks like its working! amazing! |
dicej
approved these changes
Sep 15, 2026
dicej
left a comment
Contributor
There was a problem hiding this comment.
I haven't looked at this code before, so I don't have full context for it, but the change looks reasonable to me.
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
itowlson
force-pushed
the
extract-deps-fix-dep-imports-and-exports-same-named-itf
branch
from
September 15, 2026 21:16
dc5d818 to
68467f7
Compare
itowlson
enabled auto-merge
September 15, 2026 21:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3715.
When a dep imports and exports distinct interfaces with the same unqualified name (but from different packages), the extractor could pick an imported one. In the original bug report, for example, a component exported its own secrets
storeinterface, but imported a WASI configstore.This PR limits the extractor to considering only exported interfaces (yes, it calls them imports, but that means after the dep has been importised). I am still not sure if there is a different edge case where a dep exports two interfaces with the same unqualified name - @fibonacci1729 I'd love your advice here as my brain is all muddled about it, although we can probably punt that to a separate PR.
@mileszim I have a unit test which I believe replicates your scenario, but if you have bandwidth to test this against your real code, that would help with validation. Thanks for the detailed bug report (and for taking the time to port it from the docs repo)!