WasmEdge / WasmEdge

WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.

Home Page:https://WasmEdge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: Add FreeBSD Support

rusty-eagle opened this issue · comments

Summary

Since WasmEdge provides a contained runtime, and since FreeBSD is a popular open source non-Linux alternative, it would be amazing to see WasmEdge support for FreeBSD.

There is already support for macOS, which is similar to FreeBSD. So porting this over shouldn't be too much of a hassle.

Or is there any patches already created to make this happen?

Details

FreeBSD has some wasm runtimes, but wasmedge is nice because it provides socket support. I can see people wanting to put FreeBSD on edge servers, because it provides an easy/readable firewall, an easy to use packaging system, and is a uniform system.

Appendix

No response

Hi @rusty-eagle
Thanks for this issue. FreeBSD is a popular OS. However, I am not familiar with it.
That's why I mark this issue as a help wanted issue. A PR is welcome :-).

Attached are some basic changes that allows wasmedge to compile on a FreeBSD (13.2) system and run a very basic wasm32-wasi file. The second file is a list of symbols that are likely broken/undefined.

I read that CMake classifies "UNIX" as Linux and the BSDs, so some of the lib/host/wasi/* changes were tricky, and probably not right, so I would expect this should be changed.

changes.txt
still_broken.txt

Going through the tutorials on WasmEdge's website, everything on this page works:

https://wasmedge.org/docs/develop/rust/hello_world

@hydai -- I got it working. I'll have to push the changes somewhere so they can be officially reviewed, updated, and merged.

@hydai Can we create a build or release target for FreeBSD so that @rusty-eagle can send a PR against it? Thanks.

We can have a workflow for FreeBSD since there are some Linux distros that do:

  1. https://github.com/WasmEdge/WasmEdge/blob/master/.github/workflows/reusable-build-on-fedora.yml
  2. https://github.com/WasmEdge/WasmEdge/blob/master/.github/workflows/reusable-build-on-debian-static.yml

@rusty-eagle, Would you like to submit the PR with a FreeBSD workflow? Or could you provide the building script so I can add the FreeBSD workflow for this?