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

Add windows support #180

Closed
oovm opened this issue May 21, 2024 · 3 comments · Fixed by #181
Closed

Add windows support #180

oovm opened this issue May 21, 2024 · 3 comments · Fixed by #181

Comments

@oovm
Copy link

oovm commented May 21, 2024

I want to study examples on Windows platform, but wasmtime cannot be compiled on Windows, missing FiberStack:

compile_error!("fibers are not supported on this platform");

But there is a Windows version of FiberStack:

cfg_if::cfg_if! {
if #[cfg(windows)] {
mod windows;
use windows as imp;
} else if #[cfg(unix)] {
mod unix;
use unix as imp;
} else {
compile_error!("fibers are not supported on this platform");
}
}
/// Represents an execution stack to use for a fiber.
pub struct FiberStack(imp::FiberStack);

Is there any difference between the two?

@dhil
Copy link
Member

dhil commented May 21, 2024

The baseline implementation may work on Windows. Try to build with cargo build --features=wasmfx_baseline. Though, no guarantees as we currently only aim to support x64 Linux. I suppose you can build it in WSL too.

@oovm
Copy link
Author

oovm commented May 22, 2024

I am using

[dependencies.wasmtime]
version = "*"
features = ["async", "component-model", "gc", "wasmfx_baseline"]
git = "https://github.com/wasmfx/wasmfxtime"

and

let mut config = Config::new();
{
    // FIX: exceptions proposal not enabled
    config.wasm_exceptions(true);
    // FIX: typed continuations support is not enabled
    config.wasm_typed_continuations(true);
}

But always hit

panic!("attempt to execute continuation::optimized::cont_new with `typed_continuation_baseline_implementation` toggled!")

and last call was

// Builtins for continuations. These are thin wrappers around the
// respective definitions in continuation.rs.
fn tc_cont_new(
instance: &mut Instance,
func: *mut u8,
param_count: u32,
result_count: u32,
) -> Result<*mut u8, TrapReason> {
let ans =
crate::vm::continuation::optimized::cont_new(instance, func, param_count, result_count)?;
Ok(ans.cast::<u8>())
}

@dhil
Copy link
Member

dhil commented May 22, 2024

Thanks for you patch! The whole baseline/optimized toggling is a bit of a mess (c.f. #172), something which we will clean up soon. The baseline is built directly on top of wasmtime fiber, which has Windows support, whereas with the "optimized" (should really be called development version or something like that) we use a bespoke implementation, where we are currently only developing and testing for x86_64 Linux.

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

Successfully merging a pull request may close this issue.

2 participants