bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
14.86k stars 1.24k forks source link

NetBSD/OpenBSD support #6962

Open osokin opened 10 months ago

osokin commented 10 months ago

Hi,

I've tried to compile wasmtime on NetBSD 9.3 and it's failed with the unsupported platform error in https://github.com/bytecodealliance/wasmtime/blob/main/crates/runtime/src/traphandlers/unix.rs#L257

There are limited number of OSes are supported: FreeBSD, Linux, macOS, System/390

Is there plans to support other operating system?

Thank you.

alexcrichton commented 10 months ago

PRs for unsupported platforms are welcome as they fit into our tier 3 category, and I'm not aware of anyone currently working on or planning to add support along these lines.

cfallin commented 10 months ago

@osokin you may be interested in #2980, in which I got Wasmtime working on OpenBSD at one point.

We ended up not merging this (I dropped the effort) because it was a bit of a moving target to get the system-level crates working and in particular, to get a recent-enough Rust, since rustup doesn't carry binaries for OpenBSD at all and the stable release's system package is too old for the MSRV approach most of the Rust community takes. (NetBSD/x86-64 does have rustup binaries, but e.g. aarch64 does not, so same issue there.)

IMHO at least, the most useful effort at this point would be to get Rust to provide binaries for OpenBSD and NetBSD on more architectures (x86-64, aarch64, riscv64 for OpenBSD; the latter two for NetBSD and I think FreeBSD too). Then verify compatibility (and add CI jobs to keep things compiling?) in the system crates we use -- the cap-std series, etc. Finally whatever few lines of code are needed in the traphandlers module are fine, as Alex notes, under tier 3; we can even add check-jobs to keep things compiling, with the understanding we could disable it at any point if it gets in the way too much.