Skip to content

Add support for include to wit-smith #2161

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

Merged
merged 5 commits into from
Apr 28, 2025

Conversation

alexcrichton
Copy link
Member

This commit updates the fuzz-generation of WIT documents to use include in worlds. Getting this implemented was surprisingly tricky and required some careful balancing of various constructs in generation in addition to support for round-tripping.

My hope is that this makes it easier to next add support for stability in fuzzing to enable the fuzzers to find #2113

Updates the generator to generate `include` statements in worlds to help
fuzz the `include` directive.
This commit moves a sort that previously happened during translation to
wasm to happening during general elaboration instead, meaning that
at-rest worlds are now pre-sorted in this order. Additionally printing
of WIT worlds was updated to manually respect this order where
interfaces are printed first, then types, then functions. As a result of
this change many test expectations have been updated to shuffle items
around.

The motivation for this commit is to fix fuzz failures about
round-tripping WIT documents through wasm. With `include` now supported
more test cases are showing up which stress new paths of when items are
added as they weren't tested before. This ensures that when throwing
`include` into the mix documents are still round-trip-able.
Copy link
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

Looks like some more reordered test output needs to be blessed, otherwise good?

@alexcrichton alexcrichton enabled auto-merge April 28, 2025 19:07
@alexcrichton alexcrichton added this pull request to the merge queue Apr 28, 2025
Merged via the queue into bytecodealliance:main with commit 974e0fd Apr 28, 2025
32 checks passed
@alexcrichton alexcrichton deleted the wit-smith-include branch April 28, 2025 19:34
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