You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2135: Distro packaging improvements r=syrusakbary a=jcaesar
# Description
Having installed wasmer from both gentoo and AUR (packaged by svenstaro, an Arch Maintainer), I was stumped to find that both build wasmer without compilers, not actually allowing me to run any wasm. (The AUR PKGBUILD has since been patched, but the gentoo ebuild maintainer… who knows.)
I figured that the obvious improvement would be to deny compilation if not at least one compiler is enabled, but I think more can be done to help packaging. I added
* a way to set a default for `WASMER_DIR` at compile time
* an install target for the Makefile
* a `PACKAGING.md` with some suggestions to distro maintainers
Disclaimer: I'm not a package maintainer anywhere, so these might be entirely off the rails. Commit 1 and 2 seem fairly reasonable to me, but for the other two, I'm not so sure.
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Julius Michaelis <gitter@liftm.de>
* Where possible, do not directly invoke cargo, but use the supplied Makefile
4
+
* wasmer has several compiler backends and the Makefile autodetects whether to enable llvm and singlepass.
5
+
Set `ENABLE_{CRANELIFT,LLVM,SINGLEPASS}=1` to build the full set or fail trying
6
+
* Set `WASMER_CAPI_USE_SYSTEM_LIBFFI=1` to force dynamic linking of libffi on the shared library
7
+
* `make install` respects `DESTDIR`, but `prefix` must be configured as e.g. `WASMER_INSTALL_PREFIX=/usr make all`
8
+
* In case you must build/install directly with cargo, make sure to enable at least one compiler backend feature
9
+
* Beware that compiling with `cargo build --workspace/--all --features ...` will not enable features on the subcrates in the workspace and result in a headless wasmer binary that can not run wasm files directly.
10
+
* If you split the package into several subpackages, beware that the create-exe command of wasmer requires `libwasmer.a` to be installed at `$WASMER_INSTALL_PREFIX/lib/libwasmer.a`.
11
+
Suggestion for splitting:
12
+
*`wasmer` and `wasmer-headless`, containing the respective executables
13
+
*`wasmer-headless` contains a subset of `wasmer`'s functionality and should only be packaged when splitting - it must be built explicitly with `make build-wasmer-headless-minimal insteall-wasmer-headless-minimal`
14
+
*`libwasmer`, containing `libwasmer.so*`
15
+
*`libwasmer-dev`, containging the header files and a `.pc` file
16
+
*`libwasmer-static`, containing `libwasmer.a`
17
+
18
+
The wasmer distro packaging story is still in its infancy, so feedback is very welcome.
0 commit comments