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

Document a plan for transitioning to preview 2 and beyond #476

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abrown
Copy link
Collaborator

@abrown abrown commented Feb 23, 2024

This document outlines how wasi-libc can manage the changes to WASI 0.2.0 as well as future 0.2.x releases. It's meant as a starting point for collaboration; I'm interested in your feedback.

Rendered

This document outlines how wasi-libc can manage the changes to WASI
0.2.0 as well as future 0.2.x releases. It's meant as a starting point
for collaboration; I'm interested in your feedback.
Comment on lines +16 to +17
should be identical). Future releases of WASI, e.g., 0.2.1, 0.2.2, 0.2.x,
will result in new `wasm32-wasip2.*` subdirectories.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might recommend avoiding having a directory-per-release and only having a wasm32-wasip2 directory. Per bytecodealliance/wasmtime#7860 and how other runtimes are expected to behave similarly it would be ok to take a wasi-libc compiled against WASI 0.2.2 and run it on a runtime that only supports WASI 0.2.0, so long as no new functionality from WASI 0.2.2 is actually used. C/Rust/etc are good at this since unused code can easily be statically removed, so I think that provides a smooth path to upgrade wasi-libc bindings here without disrupting the ecosystem.

`__wasilibc_use_preview2` but (a) `...wasip*` lines up the names with the
targets, making "what gets compiled where" more clear and (b) we will likely
need the ability to specify which precise version a block applies to in a
fine-grained way (e.g., `#ifdef __wasilibc_wasip0.2.2`).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sort of like above, I might recommend only __wasilibc_wasip2, but no further. (e.g. no per-point-release macros). Any one copy of the source of wasi-libc will have some version of WASI that it has bindings generated for, and the source would assume that (e.g. in theory there shouldn't need to be code for "if bigger than 0.2.1 add this code" since it would instead always be included once the WIT files are here)

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