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 WASI Preview 2 bindings #460

Merged
merged 6 commits into from
Jan 11, 2024
Merged

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Jan 4, 2024

This adds C bindings generated from the wasi:cli/[email protected] world, plus a makefile target to regenerate them from the WIT source files.

We'll use these bindings to call Preview 2 host functions when building for the wasm32-wasi-preview2 target.

@dicej dicej requested a review from sbc100 January 5, 2024 17:22
Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

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

Overall this looks good to me. Just one relatively minor detail:

libc-bottom-half/cloudlibc/src/libc/sys/wasi/preview2.c Outdated Show resolved Hide resolved
dicej added 5 commits January 11, 2024 11:29
This adds C bindings generated from the `wasi:cli/[email protected]`
world, plus a makefile target to regenerate them from the WIT source files.

We'll use these bindings to call Preview 2 host functions when building for the
`wasm32-wasi-preview2` target.

Signed-off-by: Joel Dice <[email protected]>
This includes bytecodealliance/wit-bindgen#804 (fix
broken indentation in generated code) and
bytecodealliance/wit-bindgen#805 (support overriding
world name and adding a suffix to the component type custom section).

Signed-off-by: Joel Dice <[email protected]>
Since these files aren't part of cloudlibc, no reason to put them under the
cloudlibc directory.

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej force-pushed the preview2-bindings branch from 83916d5 to 791608d Compare January 11, 2024 19:03
Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

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

Looks great!

@sunfishcode sunfishcode merged commit 47b9db6 into WebAssembly:main Jan 11, 2024
8 checks passed
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.

3 participants