zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Does not work on RISC-V 64, unsupported cranelift ISA

Open FSMaxB opened this issue 2 years ago • 8 comments

Basic information

zellij --version: zellij 0.34.4 stty size: 91 384 uname -av : Linux starfive 5.15.0-starfive #1 SMP Wed Dec 21 03:56:12 EST 2022 riscv64 GNU/Linux

Further information I recently received a Starfive VisionFive 2 RISC-V devboard, installed rust on it and installed zellij using cargo install zellij.

When trying to run zellij, I get the following error:


Error occurred in server:

  × Thread 'wasm' panicked.
  ├─▶ Originating Thread(s)
  │   	1. ipc_server: NewClient
  │   	2. screen_thread: NewTab
  │   	3. plugin_thread: NewTab
  │
  ├─▶ At /home/max/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-compiler-cranelift-2.3.0/src/config.rs:73:45
  ╰─▶ construct Cranelift ISA for triple: Unsupported
  help: If you are seeing this message, it means that something went wrong.
        Please report this error to the github issue.
        (https://github.com/zellij-org/zellij/issues)

        Also, if you want to see the backtrace, you can set the `RUST_BACKTRACE` environment variable to `1`.

I expect that this is a result from plugins being WebAssembly and whatever webassembly runtime (~~probably wasmtime~~) you use relies on cranelift, which doesn't have support for RISC-V yet.

~~According to https://docs.wasmtime.dev/stability-platform-support.html#interpreter-support, wasmtime doesn't even have an interpreter, so I guess the only way to get zellij to run on RISC-V is if it were possible to completely disable plugins, so it doesn't even try to run webassembly?~~

FSMaxB avatar Jan 22 '23 21:01 FSMaxB

~~Although this changelog entry confuses me: https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md#200~~

~~Apparently wasmtime does have support for riscv64 :thinking:~~

FSMaxB avatar Jan 22 '23 21:01 FSMaxB

Nevermind, you're using wasmer, not wasmtime.

FSMaxB avatar Jan 22 '23 21:01 FSMaxB

riscv64 is supported starting with wasmer 3.2.0. zellij is way behind on wasmer updates…

valpackett avatar May 04 '23 06:05 valpackett

I got the same/very similar issue when I tried to compile zellij from source on my RISC-V board.

ifsheldon avatar Jun 28 '23 16:06 ifsheldon

Can confirm this is still happening in 0.39.2 -- I get a glimpse of the UI, then it dies with construct Cranelift ISA for triple: Unsupported.

ToxicFrog avatar Jun 14 '24 22:06 ToxicFrog

Looking at it, it looks like RISC-V support was added in Wasmer 3.2, and Zellij is still on 3.1.1 -- so fixing this requires another Wasmer bump, which, according to #2706, is going to be difficult.

ToxicFrog avatar Jun 16 '24 13:06 ToxicFrog

More generally, it would be good if it had a way to execute plugins in an interpreter; then having a JIT for the runtime ISA is a performance optimization rather than a hard requirement.

Unfortunately, it looks like this is not something Cranelift can do, and while there's a cranelift-interpreter crate, it's still a work in progress.

ToxicFrog avatar Jun 16 '24 22:06 ToxicFrog

After #3349 merged, this issue is resolved.

pciture

Puqns67 avatar Jun 28 '24 15:06 Puqns67