1 Star 0 Fork 0

风流沙 / wasmer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
PACKAGING.md 2.03 KB
一键复制 编辑 原始数据 按行查看 历史

Wasmer OS distro packaging notes

  • Wasmer is written in Rust. To build Wasmer, where possible, do not directly invoke cargo, but use the supplied Makefile

  • Wasmer provides several compilers and the Makefile autodetects when compilers can be compiled and/or installed. Set the environment variables ENABLE_{CRANELIFT,LLVM,SINGLEPASS}=1 to force compiler to be build or to fail trying, e.g:

    $ ENABLE_LLVM=1 make build-wasmer
  • make install respects DESTDIR, but prefix must be configured with WASMER_INSTALL_PREFIX, e.g.:

    export WASMER_INSTALL_PREFIX=/usr
    make
    DESTDIR=.../usr make install
  • In case you must build/install directly with cargo, make sure to enable at least one compiler feature, like e.g. --features cranelift,

    • Beware that compiling with cargo build --workspace --features … will not enable features on the subcrates in the workspace and result in a headless Wasmer binary that can not compile Wasm files directly.
  • If you split the package into several subpackages, beware that the create-exe command of the wasmer CLI requires libwasmer.a to be installed at $WASMER_INSTALL_PREFIX/lib/libwasmer.a. Suggestions for splitting:

    • The wasmer-headless CLI contains a subset of the wasmer's functionalities and should only be packaged when splitting — it must be built explicitly with:

      $ make build-wasmer-headless-minimal install-wasmer-headless-minimal
    • libwasmer, containing libwasmer.so*,

    • libwasmer-dev, containing the header files and a .pc file,

    • libwasmer-static, containing libwasmer.a.

The Wasmer distro packaging story is still in its infancy, so feedback is very welcome.

Miscellaneous: binfmt_misc

Wasmer can be registered as a binfmt interpreter for wasm binaries. An example systemd .service is included here. Please consider statically linking the wasmer binary so that this capability is also available in mount namespaces.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mackli/wasmer.git
git@gitee.com:mackli/wasmer.git
mackli
wasmer
wasmer
master

搜索帮助