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

Error running qjs build on python or ruby wasm ext #2

Open
Munawwar opened this issue Aug 1, 2019 · 5 comments
Open

Error running qjs build on python or ruby wasm ext #2

Munawwar opened this issue Aug 1, 2019 · 5 comments

Comments

@Munawwar
Copy link

Munawwar commented Aug 1, 2019

So it is possible to compile qjuicks to wasm module. However when trying use it with python for example:

from wasmer import Instance

wasm_bytes = open('./build/qjs.wasm', 'rb').read()
instance = Instance(wasm_bytes)
print('#########')
print(instance.exports)

I get the following error:

> python3 test.py
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    instance = Instance(wasm_bytes)
RuntimeError: Failed to instantiate the module:
    19 link errors: (1 of 19) Import not found, namespace: wasi_unstable, name: fd_prestat_get (2 of 19) Import not found, namespace: wasi_unstable, name: fd_prestat_dir_name (3 of 19) Import not found, namespace: wasi_unstable, name: environ_sizes_get (4 of 19) Import not found, namespace: wasi_unstable, name: environ_get (5 of 19) Import not found, namespace: wasi_unstable, name: args_sizes_get (6 of 19) Import not found, namespace: wasi_unstable, name: args_get (7 of 19) Import not found, namespace: wasi_unstable, name: fd_read (8 of 19) Import not found, namespace: wasi_unstable, name: fd_seek (9 of 19) Import not found, namespace: wasi_unstable, name: fd_write (10 of 19) Import not found, namespace: wasi_unstable, name: fd_close (11 of 19) Import not found, namespace: wasi_unstable, name: clock_time_get (12 of 19) Import not found, namespace: wasi_unstable, name: poll_oneoff (13 of 19) Import not found, namespace: wasi_unstable, name: proc_exit (14 of 19) Import not found, namespace: wasi_unstable, name: fd_fdstat_get (15 of 19) Import not found, namespace: wasi_unstable, name: path_open (16 of 19) Import not found, namespace: wasi_unstable, name: path_rename (17 of 19) Import not found, namespace: wasi_unstable, name: path_unlink_file (18 of 19) Import not found, namespace: wasi_unstable, name: path_remove_directory (19 of 19) Import not found, namespace: wasi_unstable, name: fd_fdstat_set_flags

How to go about this?

@Munawwar
Copy link
Author

Munawwar commented Aug 3, 2019

@syrusakbary ^ do you think it's a wasmer issue rather than quickjs issue?

@saghul
Copy link
Owner

saghul commented Aug 4, 2019

Did you use the latest version of wasmer? Does it run the hello world example on wasmer? The REPL won't work yet because poll_oneoff is not yet implemented IIRC, but I don't know about the other 18 failues 😨

@Munawwar
Copy link
Author

Munawwar commented Aug 4, 2019

Latest wasmer 0.6.0, wasmer python library 0.3.0 (or ruby wasmer 0.2.0).
quickjs runs succcesfully through wasmer-cli. But the python or ruby libraries cant initialize qjs.wasm. Maybe it's a issue with wasmer python/ruby libraries?

@saghul
Copy link
Owner

saghul commented Aug 4, 2019

Maybe it's a issue with wasmer python/ruby libraries?

It's my only guess.

@syrusakbary
Copy link
Contributor

syrusakbary commented Aug 4, 2019

@Munawwar to run WASI in Wasmer embedded you need the WASI imports as well in Python/Ruby.
We are woking on making them available. Will post updates as we continue the work there :)

@syrusakbary ^ do you think it's a wasmer issue rather than quickjs issue?

Yeah, it's a Wasmer issue/feature (not an issue in quickjs) :)

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

3 participants