This repository was archived by the owner on Oct 13, 2023. It is now read-only.
host: deduplicate generated traits using only_interfaces#140
Merged
Conversation
added 8 commits
April 12, 2023 11:08
…ey can be reused in other packages
* probably there should be a lint if a name provided to `with` doesnt exist
213c413 to
949b988
Compare
dicej
approved these changes
Apr 14, 2023
added 2 commits
April 14, 2023 15:22
needed to bump the wit crate as well
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR deduplicates the types and traits genarated by host's bindgen! invocation, using the new only_interfaces feature @elliottt landed bytecodealliance/wasmtime#6160 in wasmtime.
Trevor and I discussed some minor improvements that can be made to this feature and we'll update to them when this lands, but even without this is a significant complexity reduction.
I also updated to
wit-componentto the current git main, to get the fix provided in bytecodealliance/wasm-tools#974In order to properly reuse the
environment,preopens, andexitwit interfaces in thereactor-testsworld, I needed to put them into a package, otherwise declaring those imports as available inreactor-test.witwould not unify with the way they are used in the adapter. I arbitrarily decided to name this packagewasi-base, which we should just consider a placeholder and figure out where they really live upstream soon.There are 3 separate commits for some NFC code motion that make up most of this diff - the implementions in
io,poll, andrandomwere inlined into the trait impl, since there is just one implementation now.