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

Compile test cases with wasm32-wasi again #349

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

alexcrichton
Copy link
Member

This commit is the next step in integrating wasm32-wasi, wit-bindgen, tests, and components all together. Tests are now again compiled with wasm32-wasi and use a repo-specific adapter module (with support from #338) to support transforming the final module into an actual component.

In supporting this feature the support from #331 is refactored into a new extract Rust module so the functionality can be shared between the ingestion of the main module as well as ingestion of adapter modules. Adapter modules now are also supported on the CLI as a standalone file without having to specify other options.

Note that the actual wasi_snapshot_preview1.wasm adapter is non-functional in this commit and doesn't do anything fancy. The tests in this repository don't really need all that much and I suspect all we'll really need to implement is fd_write for fd 1 (as that's stdout).

This commit is the next step in integrating `wasm32-wasi`,
`wit-bindgen`, tests, and components all together. Tests are now again
compiled with `wasm32-wasi` and use a repo-specific adapter module
(with support from bytecodealliance#338) to support transforming the final module into
an actual component.

In supporting this feature the support from bytecodealliance#331 is refactored into a
new `extract` Rust module so the functionality can be shared between
the ingestion of the main module as well as ingestion of adapter
modules. Adapter modules now are also supported on the CLI as a
standalone file without having to specify other options.

Note that the actual `wasi_snapshot_preview1.wasm` adapter is
non-functional in this commit and doesn't do anything fancy. The tests
in this repository don't really need all that much and I suspect all
we'll really need to implement is `fd_write` for fd 1 (as that's
stdout).
@alexcrichton alexcrichton marked this pull request as ready for review October 5, 2022 15:52
@alexcrichton alexcrichton requested a review from pchickey October 5, 2022 15:52
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.

Is it worth shipping a new wasmparser rn to resolve this todo?


// TODO: should remove the custom setions decoded above from the wasm binary
// created here, and bytecodealliance/wasmparser#792 should help with that
// to make the loop above pretty small.
Copy link
Contributor

Choose a reason for hiding this comment

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

yessss

@alexcrichton
Copy link
Member Author

In the interest of decoupling I'll work on that in parallel, github actions is having a fit right now and not actually running so it'll take a bit to land the wasmparser changes and for now the custom sections are otherwise harmless.

@pchickey
Copy link
Contributor

pchickey commented Oct 5, 2022

Merging so I can use this in #347

@pchickey pchickey merged commit 4df0dcd into bytecodealliance:main Oct 5, 2022
@alexcrichton alexcrichton deleted the adapter-for-wasi branch October 5, 2022 17:40
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