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

Is it possible to compile wasix without rayon support? #4308

Open
casimiro opened this issue Nov 13, 2023 · 3 comments
Open

Is it possible to compile wasix without rayon support? #4308

casimiro opened this issue Nov 13, 2023 · 3 comments
Labels
📦 lib-c-api About wasmer-c-api 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue ❓ question I've a question! 🏚 stale Inactive issues or PR

Comments

@casimiro
Copy link

Summary

rayon is listed as an optional dependency of wasix, however it seems impossible to build wasix without rayon.

Additional details

Being able to compile wasix without rayon is useful when embedding the C library in environments where thread pooling doesn't make sense.

See #4113

@casimiro casimiro added the ❓ question I've a question! label Nov 13, 2023
@theduke
Copy link
Contributor

theduke commented Nov 13, 2023

This is similar to the discussion in #4299

In short: you have to use a custom VirtualTaskManager with your own thread pool.

@casimiro
Copy link
Author

Thank you for the quick reply, @theduke.

Since I'm not embedding Wasmer within another Rust application, I tried to circumvent the thread pool creation in wasix by removing the sys-thread feature from the wasix dependency in lib/c-api/Cargo.toml:

wasmer-wasix = { version = "0.16.0", path = "../wasix", default-features = false, features = ["sys", "logging"], optional = true }

But the compilation C library stops with the following error:

   Compiling wasmer-middlewares v4.2.3 (/home/casimiro/KongHQ/wasmx/work/runtimes/libwasmer/repos/wasmer/lib/middlewares)
warning: unused import: `crate::PluggableRuntime`
  --> lib/wasix/src/state/builder.rs:17:5
   |
17 | use crate::PluggableRuntime;
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

   Compiling cranelift-frontend v0.91.1
warning: `wasmer-wasix` (lib) generated 1 warning (run `cargo fix --lib -p wasmer-wasix` to apply 1 suggestion)
error[E0432]: unresolved import `wasmer_wasix::runtime::task_manager::tokio`
  --> lib/c-api/src/wasm_c_api/wasi/mod.rs:23:29
   |
23 |     runtime::task_manager::{tokio::TokioTaskManager, InlineWaker},
   |                             ^^^^^ could not find `tokio` in `task_manager`

From the discussion in the referenced issue and the output above I assume it's currently not possible to compile the Wasmer C library without sys-thread (i.e., without rayon) by simply disabling features in Cargo files.

Copy link

stale bot commented Dec 12, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-c-api About wasmer-c-api 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue ❓ question I've a question! 🏚 stale Inactive issues or PR
Projects
None yet
Development

No branches or pull requests

3 participants