add tls-p3 example and test#205
Draft
rvolosatovs wants to merge 2 commits intobytecodealliance:mainfrom
Draft
Conversation
dicej
added a commit
to dicej/componentize-py
that referenced
this pull request
Feb 23, 2026
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 the mangled name of the payload type for
deduplication. That's not 100% reliable either, since the name mangling code
does not yet guarantee every distinct type will have a unique mangled name, so
there's more work to do there, but this at least 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 bytecodealliance#205 will
cover it once it's merged.
Collaborator
|
#206 should fix the duplicate definition issue. |
dicej
added a commit
to dicej/componentize-py
that referenced
this pull request
Feb 23, 2026
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 bytecodealliance#205 will
cover it once it's merged.
dicej
added a commit
that referenced
this pull request
Feb 24, 2026
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.
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
59db3f0 to
592c5b2
Compare
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.
This adds an example using p3
wasi-tlsinterface as defined in WebAssembly/wasi-tls#17 tested using Wasmtime from this PR bytecodealliance/wasmtime#12174Unfortunately, linting fails - it appears that
componentize-pygenerates duplicates:Given that this PR is not likely to be merged any time soon, I'm hoping that issue will be fixed in the meantime and this PR will just be rebased on top of the fix and the tests will pass. I've also based the work on my other outstanding PRs to simplify rebase in the future