Skip to content
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
pchickey merged 13 commits intomainfrom
pch/use_only_interfaces
Apr 18, 2023
Merged

host: deduplicate generated traits using only_interfaces#140
pchickey merged 13 commits intomainfrom
pch/use_only_interfaces

Conversation

@pchickey
Copy link
Collaborator

@pchickey pchickey commented Apr 12, 2023

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-component to the current git main, to get the fix provided in bytecodealliance/wasm-tools#974

In order to properly reuse the environment, preopens, and exit wit interfaces in the reactor-tests world, I needed to put them into a package, otherwise declaring those imports as available in reactor-test.wit would not unify with the way they are used in the adapter. I arbitrarily decided to name this package wasi-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, and random were inlined into the trait impl, since there is just one implementation now.

@pchickey pchickey requested a review from sunfishcode April 13, 2023 00:43
@pchickey pchickey requested a review from dicej April 14, 2023 15:40
@pchickey pchickey merged commit 0d5ca07 into main Apr 18, 2023
@pchickey pchickey deleted the pch/use_only_interfaces branch April 18, 2023 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants