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 wasm32-wasip2 support #6893

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

add wasm32-wasip2 support #6893

wants to merge 1 commit into from

Commits on Oct 9, 2024

  1. add wasm32-wasip2 support

    This adds support for the new `wasm32-wasip2` target platform, which includes
    more extensive support for sockets than `wasm32-wasip1` (formerly known as
    `wasm32-wasi`).
    
    The bulk of the changes are in tokio-rs/mio#1836.  This
    patch just tweaks a few `cfg` directives to indicate `wasm32-wasip2`'s
    additional capabilities.
    
    In the future, we could consider adding support for `ToSocketAddrs`.  WASIp2
    natively supports asynchronous DNS lookups and is single threaded, whereas Tokio
    currently assumes DNS lookups are blocking and require multithreading to emulate
    async lookups.  A WASIp2-specific implementation could do the lookup directly
    without multithreading.
    
    I've tested this end-to-end using https://github.com/dicej/wasi-sockets-tests,
    which includes smoke tests for `mio`, `tokio`, `tokio-postgres`, etc.  I'd also
    be happy to add tests to this repo if appropriate; it would require adding a
    dev-dependency on e.g. `wasmtime` to actually run the test cases.
    
    Signed-off-by: Joel Dice <[email protected]>
    dicej committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    19bca4c View commit details
    Browse the repository at this point in the history