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

problems building js-polyfill #154

Closed
jrandall opened this issue May 18, 2019 · 4 comments
Closed

problems building js-polyfill #154

jrandall opened this issue May 18, 2019 · 4 comments

Comments

@jrandall
Copy link

I get an error when I try to build the browser polyfill:

~/checkouts/wasmtime/wasmtime-wasi/js-polyfill$ ./build.sh 
error: Linking globals named 'rwlock_init': symbol multiply defined!
shared:ERROR: Failed to run llvm optimizations: 

I am using emscripten 1.38.31:

~/checkouts/wasmtime/wasmtime-wasi/js-polyfill$ emcc --version
emcc (Emscripten gcc/clang-like replacement) 1.38.31 (commit 040e49ad1e084ab4c464a9ca098c49b8c7085ffe)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What version(s) of emscripten are known to work to build the polyfill?

@sunfishcode
Copy link
Member

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.

@jrandall
Copy link
Author

Thanks! Is there a polyfill for the Rust-based implementation, and it just doesn't have a build script? Happy to cargo build something instead if that works.

@sunfishcode
Copy link
Member

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 cargo build to wire everything up, but in theory shouldn't be too crazy.

kubkon pushed a commit that referenced this issue Nov 7, 2019
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.
kubkon pushed a commit that referenced this issue Nov 7, 2019
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`.
grishasobol pushed a commit to grishasobol/wasmtime that referenced this issue Nov 29, 2021
* Run rustfmt check on CI

* Reformat.
@bjorn3
Copy link
Contributor

bjorn3 commented Jan 26, 2023

I think this can be closed now as the polyfill at https://wasi.dev/polyfill/index.html is gone.

pchickey added a commit to pchickey/wasmtime that referenced this issue May 12, 2023
…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<()> {
pchickey added a commit to pchickey/wasmtime that referenced this issue May 16, 2023
…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<()> {
mooori pushed a commit to mooori/wasmtime that referenced this issue Dec 20, 2023
dhil added a commit to dhil/wasmtime that referenced this issue Apr 5, 2024
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this issue Oct 18, 2024
Fix the `Extend` spec to use 8-bit bitvectors for `from_bits` and
`to_bits`.
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

No branches or pull requests

4 participants