dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
489 stars 9 forks source link

Trying to check out zjstatus, but it fails #78

Closed olekspickle closed 4 months ago

olekspickle commented 4 months ago

Describe the bug Trying to check out zjstatus, but apparently it does not want to load :( not sure if its a zjstatus thing or zellij bug, direct me if necessary

To Reproduce Steps to reproduce the behavior:

  1. run new session with zjstatus.wasm defined

Expected behavior zjstatus would show as in screenshots

Screenshots Screenshot_20240723_164446

Desktop (please complete the following information):

Layout

How does the layout look like? Please copy it into a code block.

layout {
    default_tab_template {
        children
        pane size=1 borderless=true {
            plugin location="file:~/.config/zellij/plugins/zj_status.wasm" {

            }
        }
    }
    tab name="☍ dev" {
        pane
    }
    tab name="ꆛconfig"{
        pane
    }
 }

Additional context

ERROR  |zellij_server::plugins::w| 2024-07-23 16:36:37.374 [async-std/runti] [/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zellij-server-0.40.1/src/plugins/wasm_bridge.rs:1224]: failed to start plugin 0 for client 1

Caused by:
    0: failed to recover cache dir
    1: WebAssembly translation error: Error when converting wat: expected at least one module field
            --> <anon>:1:1
             |
           1 |
             | ^
dj95 commented 4 months ago

Hi and thanks for your bug report.

Can you please ensure, that the downloaded file is not corrupted?

$ shasum -a 256 zjstatus.wasm # on linux it's sha256sum zjstatus.wasm
2204df4a5db811aa7ed3385f8b04ef99d572fddaf23f17c417b2e154d5577be5  zjstatus.wasm

If it has the correct checksum, please validate the path in your layout file. Use the default name of the wasm file (no special characters). Then kill all zellij sessions and delete the serialised ones (for resurrection). Use one of the simple examples in the config, to see an actual bar. Clean the cache directory and try to start zellij. This should resolve the issue.

I've used the downloaded binary with linux while debugging an issue yesterday, so unfortunately I'm not able to reproduce the issue :/

olekspickle commented 4 months ago

did all you suggested - same result. For cache clean I use rm -rf ~/.cache/zellij/*. If there is a cache problem, where else can it lie?

❯ sha256sum  zj_status.wasm
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  zjstatus.wasm

UPD: I think I know what the problem is. I wanted to script my reproducible env and it seems curling wasm package yields incorrect wasm binary, I bet the one I downloaded by hands work

➜ sha256sum  zjstatus.wasm
2204df4a5db811aa7ed3385f8b04ef99d572fddaf23f17c417b2e154d5577be5  zjstatus.wasm

~/Downloads on ☁ (eu-west-1)
➜ curl -s https://github.com/dj95/zjstatus/releases/download/v0.17.0/zjstatus.wasm -o zjstatus2.wasm

~/Downloads on ☁ (eu-west-1)
➜ sha256sum  zjstatus2.wasm
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  zjstatus2.wasm
dj95 commented 4 months ago

Try to download it with wget. This works perfectly on my side. So I guess that's the problem, why it doesn't load.

Then we can close the issue, if it loads fine when downloaded manually


Edit: Problem with curl is a redirect. You receive an empty wasm file. If you add -L to the params, it should work also with curl.

olekspickle commented 4 months ago

yep, you are completely right, my bad forgetting the redirect Thank you so much for your time and plugin!