-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
problems building js-polyfill #154
Comments
We're in the process of moving the WASI implementation from C to Rust, and the polyfill build script doesn't yet support Rust. We'll eventually fix that, but in the meantime I created a polyfill branch to preserve the full C version, which should build with any reasonably recent version of Emscripten. |
Thanks! Is there a polyfill for the Rust-based implementation, and it just doesn't have a build script? Happy to |
The plan is to port the support code over to wasi-common, which is written in Rust, and compile that with wasm32-unknown-emscripten. It'll need more work than just a |
This commit implements a simple helper for converting `&str` to `CString` and mapping to the appropriate WASI error. It also adds a `path_cstring` helper method in `PathGet` where the conversion was used the most. Fixes #104.
Unfortunately the helpers added in #154 were only used from non-Windows implementations, which caused compiler warnings on Windows. This commit moves the helper to be unix-specific and removes the tiny wrapper around calling `str_to_cstring` on `PathGet.path`.
* Run rustfmt check on CI * Reformat.
I think this can be closed now as the polyfill at https://wasi.dev/polyfill/index.html is gone. |
…h that error (bytecodealliance#154) * adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error There was a special case in poll_oneoff that put in a fake clock stream when a read/write stream for a descriptor wasn't available. The poll_oneoff_files test (in `test_fd_readwrite_invalid_fd()`) checks that poll_oneoff returns a BADF when an invalid fd is subscribed to. I'm not sure what the special case was patching over, but this passes all of the other tests right now. * poll_oneoff_files fails on windows with god knows what error diff --git a/host/tests/command.rs b/host/tests/command.rs index 7af7bd0..67c8c0b 100644 --- a/host/tests/command.rs +++ b/host/tests/command.rs @@ -466,10 +466,11 @@ async fn run_path_symlink_trailing_slashes(store: Store<WasiCtx>, wasi: Command) } async fn run_poll_oneoff_files(store: Store<WasiCtx>, wasi: Command) -> Result<()> { - // trapping upwrap in poll_oneoff in adapter. - // maybe this is related to the "if fd isnt a stream, request a pollable which completes - // immediately so itll immediately fail" behavior, which i think breaks internal invariant... - run_with_temp_dir(store, wasi).await + if cfg!(windows) { + expect_fail(run_with_temp_dir(store, wasi).await) + } else { + run_with_temp_dir(store, wasi).await + } } async fn run_poll_oneoff_stdio(store: Store<WasiCtx>, wasi: Command) -> Result<()> {
…h that error (bytecodealliance#154) * adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error There was a special case in poll_oneoff that put in a fake clock stream when a read/write stream for a descriptor wasn't available. The poll_oneoff_files test (in `test_fd_readwrite_invalid_fd()`) checks that poll_oneoff returns a BADF when an invalid fd is subscribed to. I'm not sure what the special case was patching over, but this passes all of the other tests right now. * poll_oneoff_files fails on windows with god knows what error diff --git a/host/tests/command.rs b/host/tests/command.rs index 7af7bd0..67c8c0b 100644 --- a/host/tests/command.rs +++ b/host/tests/command.rs @@ -466,10 +466,11 @@ async fn run_path_symlink_trailing_slashes(store: Store<WasiCtx>, wasi: Command) } async fn run_poll_oneoff_files(store: Store<WasiCtx>, wasi: Command) -> Result<()> { - // trapping upwrap in poll_oneoff in adapter. - // maybe this is related to the "if fd isnt a stream, request a pollable which completes - // immediately so itll immediately fail" behavior, which i think breaks internal invariant... - run_with_temp_dir(store, wasi).await + if cfg!(windows) { + expect_fail(run_with_temp_dir(store, wasi).await) + } else { + run_with_temp_dir(store, wasi).await + } } async fn run_poll_oneoff_stdio(store: Store<WasiCtx>, wasi: Command) -> Result<()> {
Add helpers for SHA256
Fix the `Extend` spec to use 8-bit bitvectors for `from_bits` and `to_bits`.
I get an error when I try to build the browser polyfill:
I am using emscripten 1.38.31:
What version(s) of emscripten are known to work to build the polyfill?
The text was updated successfully, but these errors were encountered: