zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.55k stars 2.64k forks source link

Not ready for WSL-2 #14173

Closed chiddekel closed 2 weeks ago

chiddekel commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Not Ready for WSL-2 - on Wayland display noting - on X11 only Window Frame (can click on middle of window and see only background of windows wallpaper)

Environment

WSL-2

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log


Mylloon commented 1 month ago

I think WSL support will come with #5347

paul-primes commented 1 month ago

I did some digging: my Zed log file is basically empty:

2024-07-15T09:56:44+02:00 [INFO] ========== starting zed ==========
2024-07-15T10:21:20.972903623+02:00 [INFO] ========== starting zed ==========

Starting zed in foreground mode:

zed --foreground ./develop/
thread 'main' panicked at crates/gpui/src/platform/linux/wayland/client.rs:143:51:
called `Result::unwrap()` on an `Err` value: UnsupportedVersion
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

going even further:

export RUST_BACKTRACE=1
zed --foreground ./develop
thread 'main' panicked at crates/gpui/src/platform/linux/wayland/client.rs:143:51:
called `Result::unwrap()` on an `Err` value: UnsupportedVersion
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: gpui::platform::linux::wayland::client::Globals::new
   4: gpui::platform::linux::wayland::client::WaylandClient::new
   5: gpui::app::App::new
   6: zed::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

And going even further here as well:

export RUST_BACKTRACE=full
zed --foreground ./develop
thread 'main' panicked at crates/gpui/src/platform/linux/wayland/client.rs:143:51:
called `Result::unwrap()` on an `Err` value: UnsupportedVersion
stack backtrace:
   0:     0x55b14622b3b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1e1a1972118942ad
   1:     0x55b143abd22b - core::fmt::write::hc090a2ffd6b28c4a
   2:     0x55b1462261f3 - std::io::Write::write_fmt::h8898bac6ff039a23
   3:     0x55b14622b12e - std::sys_common::backtrace::print::ha96650907276675e
   4:     0x55b14622ca6e - std::panicking::default_hook::{{closure}}::h215c2a0a8346e0e0
   5:     0x55b14622c746 - std::panicking::default_hook::h207342be97478370
   6:     0x55b14622cf46 - std::panicking::rust_panic_with_hook::hac8bdceee1e4fe2c
   7:     0x55b14622ce44 - std::panicking::begin_panic_handler::{{closure}}::h00d785e82757ce3c
   8:     0x55b14622b879 - std::sys_common::backtrace::__rust_end_short_backtrace::h1628d957bcd06996
   9:     0x55b14622cba7 - rust_begin_unwind
  10:     0x55b142d1b413 - core::panicking::panic_fmt::hdc63834ffaaefae5
  11:     0x55b142d1b8c6 - core::result::unwrap_failed::h82b551e0ff2b2176
  12:     0x55b144b8fff7 - gpui::platform::linux::wayland::client::Globals::new::hd07f5eb9cf8372df
  13:     0x55b144b93c35 - gpui::platform::linux::wayland::client::WaylandClient::new::h53026c448b65ace0
  14:     0x55b144b29213 - gpui::app::App::new::hde7595f2cf516692
  15:     0x55b1475bb94e - zed::main::h13987f1961ec105a
  16:     0x55b1473d1533 - std::sys_common::backtrace::__rust_begin_short_backtrace::he0fe587f0c728287
  17:     0x55b147455be9 - std::rt::lang_start::{{closure}}::h5d7b762fd887c8c3
  18:     0x55b14621b026 - std::rt::lang_start_internal::h3ed4fe7b2f419135
  19:     0x55b1475be07c - main
  20:     0x7ff84a70bd90 - <unknown>
  21:     0x7ff84a70be40 - __libc_start_main
  22:     0x55b142f8ebfe - _start
  23:                0x0 - <unknown>

The last thing i tried was setting Wayland_DISPLAY=''. That at least shows a small window i can move around but not do anything else. It is shine through but can be moved around. grafik

Hope that helps somehow. But i think it needs a bit of debugging the code inside of wsl to see why it fails.

kanowfy commented 1 month ago

I had the same issue where zed would launch via WAYLAND_DISPLAY= zed but not showing anything besides an empty window. It was due to vulkan not being correctly setup. I managed to fixed it by updating mesa driver through kisak ppa and use liquorix kernel.

sudo add-apt-repository ppa:damentz/liquorix
sudo apt update
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

After that, vkcube shows the actual GPU instead of llvmpipe and zed launched properly:

image image

chiddekel commented 1 month ago

I had the same issue where zed would launch via WAYLAND_DISPLAY= zed but not showing anything besides an empty window. It was due to vulkan not being correctly setup. I managed to fixed it by updating mesa driver through kisak ppa and use liquorix kernel.

sudo add-apt-repository ppa:damentz/liquorix
sudo apt update
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

This approach to topic - make it zed on WSL-2 with X11/X.org work, great - thanks!

paul-primes commented 1 month ago

Even launching zed this way, seems quite slow and cumbersome. Somehow something is still missing. Also the commands to install the liquorix kernel are not enough, and is a kernel upgrade even necessary?

chiddekel commented 1 month ago

Even launching zed this way, seems quite slow and cumbersome. Somehow something is still missing. Also the commands to install the liquorix kernel are not enough, and is a kernel upgrade even necessary?

If
WAYLAND_DISPLAY='' is set to "" then runing zed on X11/X.org