Skip to content

Commit

Permalink
Update the wasm-tools family of crates, disallow empty component types (
Browse files Browse the repository at this point in the history
bytecodealliance/wasmtime#6777)

* Remove unused WIT files from Wasmtime

These files aren't actually read by anything currently. They were added
historically and a previous refactoring in #6390 forgot to remove them.
No tests or build process reads them so this deletes them to get them
out of the way.

* Update dependencies on wasm-tools crates.

This commit updates the deps on the wasm-tools family of crates to bring
in a few fixes for WIT/component-related things. Primarily though this
brings in an update to the component model where empty types are now
disallowed.

Some tests using empty types were adjusted to use non-empty types, but
many tests were also simply removed as they existed to test what would
happen with empty types which now no longer needs to be tested.

* Update `stream-error` in preview2

Add a `dummy` field to make it a non-empty structure. It's expected that
this will change to something else more "official" in the future, but
for now this is here to keep everything compiling.

* Update component fuzzing to avoid empty types

Empty types are no longer valid

* Update crates/wasi/wit/deps/io/streams.wit

Co-authored-by: Peter Huene <peter@huene.dev>

---------

Co-authored-by: Peter Huene <peter@huene.dev>
  • Loading branch information
2 people authored and rvolosatovs committed Aug 24, 2023
1 parent cd72925 commit 9ea2be2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions streams.wit
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ package wasi:io
interface streams {
use wasi:poll/poll.{pollable}

/// An error type returned from a stream operation. Currently this
/// doesn't provide any additional information.
record stream-error {}
/// An error type returned from a stream operation.
///
/// TODO: need to figure out the actual contents of this error. Used to be
/// an empty record but that's no longer allowed. The `dummy` field is
/// only here to have this be a valid in the component model by being
/// non-empty.
record stream-error {
dummy: u32,
}

/// Streams provide a sequence of data and then end; once they end, they
/// no longer provide any further data.
Expand Down

0 comments on commit 9ea2be2

Please sign in to comment.