Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stream/future/error-context to wit-smith #1959

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Dec 18, 2024

I had to tweak fuzz/src/wit64.rs because otherwise the old version of wit-component it was using choked on these new types. Now we just return early when that happens.

Otherwise, there was just one other failure in the 15+ minutes I've been running the fuzzer: I had neglected to support the new types in WitPrinter::declare_type thinking it wasn't necessary, but I was wrong.

@@ -893,6 +897,54 @@ impl WitPrinter {
Ok(())
}

fn declare_stream(&mut self, resolve: &Resolve, name: Option<&str>, ty: &Type) -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this take a non-optional name and an error be generated above if ty.name is none?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the precedent set by declare_list, declare_option, etc. above, which all take a Option<&str>. Should all of them be changed to non-optional? Or if not, what's different about stream?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no I didn't realize that's how everything worked. It feels weird to me to have a method that when it doesn't do anything it's silently a bug, but if it's how everything else is there's no need to change just this method.

I had originally thought that code was unreachable for such types, but
`wit-smith` taught me otherwise.

Signed-off-by: Joel Dice <[email protected]>

add stream/future/error-context to wit-smith

I had to tweak fuzz/src/wit64.rs because otherwise the old version of
`wit-component` it was using choked on these new types.  Now we just return
early when that happens.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej force-pushed the wit-smith-stream-etc branch from 4483389 to 2ce3a57 Compare December 19, 2024 17:35
@dicej dicej added this pull request to the merge queue Dec 19, 2024
Merged via the queue into bytecodealliance:main with commit e0e94e3 Dec 19, 2024
30 checks passed
@dicej dicej deleted the wit-smith-stream-etc branch December 19, 2024 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants