I just wanted to confirm that this is a bug and that I'm not doing something wrong before I report it.
If I have the following, both resource-a
and resource-b
are treated as exported GuestResources as I'd expect.
world example {
export some-interface;
}
interface some-interface {
resource resource-a {
}
resource resource-b {
get-a: func() -> result<resource-a>;
}
}
However, if I define them in separate interfaces, only resource-b seems to be treated as an exported resource.
world example {
export some-other-interface;
}
interface some-interface {
resource resource-a {
}
}
interface some-other-interface {
use some-interface.{resource-a};
resource resource-b {
get-a: func() -> result<resource-a>;
}
}
I believe that is intended behavior, and it's also been a recurring source of confusion. See https://github.com/WebAssembly/component-model/issues/208
If you add export some-interface;
to your world in the second example, it should work like the first example.
That is confusing. I would expect that a resource that is exported via an exported function (either in the interface, world, or an exported resource) would also be exported regardless. Thanks for the insight. I'll read through that issue and comment if necessary.
Last updated: Nov 22 2024 at 16:03 UTC