Skip to content

Releases: bytecodealliance/componentize-py

canary

24 Feb 00:59
89af297

Choose a tag to compare

canary Pre-release
Pre-release
avoid generating duplicate stream and future constructors (#206)

Previously, we used the payload type to avoid generating duplicates, but that
doesn't work reliably because `wit-parser` does not necessarily deduplicate
types involving aliases, such as the following example:

```
interface types {
  variant foo {
    bar,
    baz
  }
}

interface use-types-a {
  use types.{foo};

  test: func() -> future<result<foo>>;
}

interface use-types-b {
  use types.{foo};

  test: func() -> future<result<foo>>;
}
```

When targetting a world which imports and/or exports both `use-types-a` and
`use-types-b`, we'll end up with distinct type IDs for `result<foo>`.

This commit switches to using `wit-bindgen-core` to determine the "canonical"
type of the payload and then use that as the deduplication key.  This unblocks
using `wasi:cli@0.3.0-rc-2026-02-09`, which has a similar pattern to the above
WIT example.

Note that this is awkward to test given our current test infra, but #205 will
cover it once it's merged.