zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Support for armv7-unknown-linux-musleabihf

Open SirVer opened this issue 1 year ago • 2 comments

In my company and for our IoT devices, we are in the market for a tmux-like terminal multiplexer that is easy to statically link, i.e. having a self contained binary. Our needs are very modest, only terminal creation, tabs, detaching and attaching. Zellij seems to fit this requirements excellently.

However, when trying to cross compile using cross build --release --target=armv7-unknown-linux-musleabihf I get the following error:

error: unsupported platform
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-vm-1.0.2/src/trap/traphandlers.rs:275:21
    |
275 |                     compile_error!("unsupported platform");
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-vm-1.0.2/src/trap/traphandlers.rs:197:52
    |
197 |         unsafe fn get_pc(cx: *mut libc::c_void) -> *const u8 {
    |                   ------                           ^^^^^^^^^ expected *-ptr, found `()`
    |                   |
    |                   implicitly returns `()` as its body has no tail or `return` expression
    |
    = note: expected raw pointer `*const u8`
                 found unit type `()`

For more information about this error, try `rustc --explain E0308`.

I understand that zellij uses wasm for plugins. I wonder if I can get a "super simple" version that does not use wasm somehow to cross compile?

SirVer avatar Aug 14 '22 21:08 SirVer

Hey @SirVer - first: it should definitely be possible to compile without plugins. This will give Zellij without the interface though - which depending on your use case might be less or more desirable.

However, what we usually do is compile the wasm plugins into a "dev-data" directory and then compile the rest of Zellij and load them into the binary. We already do this for eg. the e2e tests and the generic musl build in the releases.

This is done by our (admittedly somewhat convoluted) build-system. It's a little late for me, so I'm going to point out the relevant part of the build-system, and if you have questions I'd be happy to give more detailed instructions tomorrow or the day after: https://github.com/zellij-org/zellij/blob/main/Makefile.toml#L195

For more information about building zellij: https://github.com/zellij-org/zellij/blob/main/CONTRIBUTING.md#building

Please do let me know if I can help or if you have any questions.

imsnif avatar Aug 15 '22 20:08 imsnif

@imsnif I tried finding my way through the build system now. I managed to build for mac os and run it (though I did not see anything when it ran but a black window). However cargo make ci-build-release armv7-unknown-linux-musleabihf did not work for me. I did not manage to get a working arm binary going.

SirVer avatar Sep 10 '22 13:09 SirVer