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

Importing wasm module that uses wasmer-wasix #4718

Open
fgrebenac opened this issue May 18, 2024 · 3 comments
Open

Importing wasm module that uses wasmer-wasix #4718

fgrebenac opened this issue May 18, 2024 · 3 comments
Assignees
Labels
🧞 needs example The issue needs an example on how to do it 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue ❓ question I've a question!

Comments

@fgrebenac
Copy link

Summary

Can't import wasm module that uses wasmer-wasix.

Additional details

I'm trying to import wasm module that uses tokio and reqwest crates from https://github.com/wasix-org using wasmer-wasix as explained in examples.
I compile wasm module with cargo wasix build --release and run the main Rust program with cargo run --release.
When I try to import it using WasiEnv from wasmer-wasix crate, I get the following error:
Error: Link(Import("wasix_32v1", "futex_wake", UnknownImport(Function(FunctionType { params: [I32, I32], results: [I32] }))))

It happens when I'm trying to create new Instance from import object.

Does anyone know why this happens and how can I fix it?

@fgrebenac fgrebenac added the ❓ question I've a question! label May 18, 2024
@syrusakbary
Copy link
Member

Hey @fgrebenac, can you post here the full .wasm file (probably attached as a Zip). If you have also the source code that would be even better.

This may be happening because there might be an extra import outside what WASIX can recognize, and that's makes the WASIX crate not recognize all the imports, and not provide the required WASIX imports

@syrusakbary syrusakbary added 🕵️ needs investigation The issue/PR needs further investigation 🧞 needs example The issue needs an example on how to do it priority-medium Medium priority issue labels May 21, 2024
@fgrebenac
Copy link
Author

Thanks for answering.

I'm attaching a zip file with source code and .wasm file.

In root folder there are Wasm and Main folders, and gpio_module.wasm file - wasm compiled with cargo wasix build --release command.

Wasm folder contains Cargo.toml and lib.rs files of Rust project that is getting compiled to wasm.
Main folder contains source code of the program that is supposed to import the module.

Wasmer-files.zip

@fgrebenac
Copy link
Author

Any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧞 needs example The issue needs an example on how to do it 🕵️ needs investigation The issue/PR needs further investigation priority-medium Medium priority issue ❓ question I've a question!
Projects
None yet
Development

No branches or pull requests

3 participants