zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
19.75k stars 618 forks source link

Layout strider crashes on macOS M1 #526

Open DavSanchez opened 3 years ago

DavSanchez commented 3 years ago

Hi guys,

I don't know how the wasmer-wasi code is being called here, but attempting to use zellij --layout strider on macOS (M1) panics with the following (reaches an unimplemented! macro):

$ zellij --layout strider
Originating Thread(s):
1. ipc_server: NewClient
2. ipc_server: NewClient
3. pty_thread: NewTab
4. screen_thread: ApplyLayout
5. plugin_thread: Load

Error: thread 'wasm' panicked at 'not implemented: Absolute symlinks are not yet supported': /Users/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmer-wasi-1.0.2/src/state/mod.rs:812
   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: zellij::common::errors::handle_panic
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_handler::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: _rust_begin_unwind
   7: core::panicking::panic_fmt
   8: wasmer_wasi::state::WasiFs::get_inode_at_path_inner
   9: wasmer_wasi::syscalls::path_filestat_get
  10: <Func as wasmer::externals::function::inner::HostFunction<(A1,A2,A3,A4,A5),Rets,wasmer::externals::function::inner::WithEnv,Env>>::function_body_ptr::func_wrapper

Calling just zellij works normally.

Basic information

zellij --version: tested with 0.8.0 (Homebrew) and 0.11.0 (Cargo) tput lines: 25 tput cols: 80 uname -av or ver(Windows): Darwin hostname.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64

List of programs you interact with as, PROGRAM --version: iTerm 3.4.6

Further information Reproduction steps, noticable behavior, related issues etc

imsnif commented 3 years ago

Thanks for opening the issue. This happens because unfortunately at the moment WASI has some issues with symlinks (please correct me if I'm wrong @TheLostLambda). You would be able to open it in a directory that does not contain them (this is also true to all child directories). Hopefully we can find a workaround for this soon.

DavSanchez commented 3 years ago

Ahh I see, so that was the problem then! Just tested on a directory without symlinks and it works. Let's hope it can be fixed soon.

Thanks @imsnif

varac commented 2 years ago

Same happens for me (using 0.15.0 installed via homebrew on an PopOS 21.04 system).

varac commented 2 years ago

This happens because unfortunately at the moment WASI has some issues with symlinks (please correct me if I'm wrong @TheLostLambda).

Is there already an upstream issue you can link to ?

ken-matsui commented 2 years ago

@DavSanchez @imsnif Hi,

I tried reproducing this problem (because I have an M1 mac), but I found this problem has already been fixed in the main branch.

I could confirm the zellij --layout strider command using the main branch successfully runs on iTerm2, Terminal.app, Alacritty, and inline terminal of Intellij.

FYI, this is my uname -av result:

Darwin Kens-MacBook-Pro-2021.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 arm64

So, I think this issue should be closed.

a-kenji commented 2 years ago

@ken-matsui Did you try it with a symlink in the directory you were starting the layout at? We suspect that this was the problem, and I am not sure if that is already fixed.

ken-matsui commented 2 years ago

@a-kenji Ahhh, sorry. I didn't recognize it. I'm sorry to bother you, but could you please tell me how to do reproduce it?

a-kenji commented 2 years ago

Sure! I am not sure if darwin uses the same tools, so I assume it should work like this: Create a symlink.

ln -s /path/to/original /path/to/link

Verify:

ls -l

You can see if you have a symlink in the directory when you see the ->.

Then run zellij -l strider in the directory.

ken-matsui commented 2 years ago

Thank you so much! I'll try it!

ken-matsui commented 2 years ago

@a-kenji I could reproduce this; also, I hid the first comment to avoid confusing anyone. Thank you!

I found an issue related to this PR. For someone being concerned about progress, I link it:

a-kenji commented 2 years ago

@ken-matsui No problem, also thanks for finding the issue!

cc @varac, we found the issue.

imsnif commented 2 years ago

Just a quick suggestion: can we bypass this with UX for the time being?

Something like: swallow this error, display the link name (but have it not lead anywhere) and display a star at the bottom of Strider when it's selected reading "Symlinks currently unsupported"?

Not the perfect usability, but at least it won't crash?

ken-matsui commented 2 years ago

@imsnif Thank you for your suggestion. I also think it would be better than it will panic. May I investigate if we can bypass it?

imsnif commented 2 years ago

Of course! That would be great

jigypeper commented 6 months ago

I have a "Received empty message from server" error whenever i try to run 'zellij --layout strider' Its instantaneous and doesn't appear to discriminate which folder i start it in.

jigypeper commented 6 months ago

Ok so i installed with Homebrew and it looks like its looking for the plug-ins in org.Zellij-Contributors.Zellij/ and this folder doesn't actually exist. Very odd

jacksonfernando commented 5 months ago

@jigypeper do you have the solution yet? cause i have the same issue

jigypeper commented 5 months ago

@jacksonfernando i just downgraded to 0.38.2 on macOS. Haven't had the chance to investigate further. šŸ«¤