2.1 KiB
Wasmer OS distro packaging notes
-
Wasmer is written in Rust. To build Wasmer, where possible, do not directly invoke
cargo, but use the suppliedMakefile -
Wasmer provides several compilers and the
Makefileautodetects when compilers can be compiled and/or installed. Set the environment variablesENABLE_{CRANELIFT,LLVM,SINGLEPASS}=1to force compiler to be build or to fail trying, e.g:$ ENABLE_LLVM=1 make build-wasmer -
make installrespectsDESTDIR, butprefixmust be configured withWASMER_INSTALL_PREFIX. Note thatDESTDIRmust includeWASMER_INSTALL_PREFIX, e.g.:export WASMER_INSTALL_PREFIX=/usr make DESTDIR=/tmp/staging/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.
- Beware that compiling with
-
If you split the package into several subpackages, beware that the
create-execommand of thewasmerCLI requireslibwasmer.ato be installed at$WASMER_INSTALL_PREFIX/lib/libwasmer.a. Suggestions for splitting:-
The
wasmer-headlessCLI contains a subset of thewasmer'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, containinglibwasmer.so*, -
libwasmer-dev, containing the header files and a.pcfile, -
libwasmer-static, containinglibwasmer.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.