wip(fix): import mapping resource overlap #557
Draft
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.
This commit attempts to fix the case of an import map that perfectly overlaps an existing component resource.
When a resource that exists in a component is overriden with an import map, the interface can change arbitrarily.
This handle failure seems to actually be much deeper... Where I've landed is that resources are broken when import mapped over.
I've been able to figure out that the import map'd resource that overlaps with the local one is being interpreted as a host & imported & owned resource.
They basically are being detected as owned when they should not be -- while it is possible to have a
ResourceData::Host
that is imported and owned, in this case the resource is actually coming from the import map (it's not the same resource as the component created/is in the WIT).I can't tell if the right move here is to:
I'm thinking it might be a componentize problem because the function in the WASM has no idea about the import mapping above, and is probably trying to lower using the definitions in the component (that don't match the import map).
The first issue was attempting to remove the resource that wasn't actually successfully created which I found a way to work around (that maybe makes sense), but I'm finding that while you can create the resource, you can't consume it (i.e. from
consumeBar
) inside the component.