elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
8.9k stars 370 forks source link

Problem with starting eww under musl #253

Open mitinarseny opened 2 years ago

mitinarseny commented 2 years ago

Nope, the issue has not been magically resolved... Even with new YUCK configuration language.

$ ./eww --debug --logs --restart daemon
 2021-08-31T19:46:49.858Z INFO  eww > Initializing Eww server. (/run/user/1000/eww-server_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=)
 2021-08-31T19:46:49.858Z INFO  eww::server > Loading paths: config-dir: /home/mitinarseny/.config/eww, ipc-socket: /run/user/1000/eww-server_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=, log-file: /home/mitinarseny/.cache/eww_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=.log

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

And then I then:

./eww open example
 2021-08-31T19:46:54.654Z WARN  eww > Failed to connect to daemon: Failed to connect to daemon
 2021-08-31T19:46:54.654Z INFO  eww > Initializing eww server. (/run/user/1000/eww-server_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=)
Run `./eww logs` to see any errors while editing your configuration.
 2021-08-31T19:46:54.654Z INFO  eww::server > Loading paths: config-dir: /home/mitinarseny/.config/eww, ipc-socket: /run/user/1000/eww-server_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=, log-file: /home/mitinarseny/.cache/eww_L2hvbWUvbWl0aW5hcnNlbnkvLmNvbmZpZy9ld3c=.log

With following contents of ${XDG_CONFIG_DIR}/eww/eww.yuck:

(defwindow example
           :monitor 0
           :geometry (geometry :x "0%"
                               :y "20px"
                               :width "90%"
                               :height "30px"
                               :anchor "top center")
           :stacking "fg"
           :reserve (struts :distance "40px" :side "top")
           :windowtype "dock"
           :wm-ignore false
  "example content")

Originally posted by @mitinarseny in https://github.com/elkowar/eww/issues/203#issuecomment-909562452

legendofmiracles commented 2 years ago

Just to be exactly clear: the log command is still running alongside the open command, and no further output appeared? Is eww still running? Does eww ping work? It's hard, to impossible, to debug issues that can't be reproduced (the above mentioned config works for me) - do you happen to have knowledge with an debugger in order give more insights?

Animeshz commented 2 years ago

Are you using X or Wayland? Seems like daemon does not start.

I'd guess that it stucks at line number 57.

https://github.com/elkowar/eww/blob/9c12a316d6e3c3b1b504bf1ed86de5241694ef2a/crates/eww/src/server.rs#L41-L60

Which distro you are using, does it have gtk?

mitinarseny commented 2 years ago

Yes, eww logs is still running in a separate shell. I am using Wayland in Void Linux with gtk installed.

Unfortunately, I have no debugging experience in Rust.

snakedye commented 2 years ago

Read the eww documentation on Wayland specifically

uncomfyhalomacro commented 2 years ago

I can confirm this happens to me in voidlinux with similar output

$ eww daemon --debug
 2021-09-25T21:21:31.562Z INFO  eww > Initializing Eww server. (/run/user/1000/eww-server_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==)
Run `eww logs` to see any errors while editing your configuration.
 2021-09-25T21:21:31.562Z INFO  eww::server > Loading paths: config-dir: /home/uncomfy/.config/eww, ipc-socket: /run/user/1000/eww-server_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==, log-file: /home/uncomfy/.cache/eww_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==.log

 $ eww open river-bar --debug
 2021-09-25T21:21:43.573Z DEBUG eww > Trying to find server process at socket /run/user/1000/eww-server_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==
 2021-09-25T21:21:44.575Z WARN  eww > Failed to connect to daemon: Failed to connect to daemon
 2021-09-25T21:21:44.575Z INFO  eww > Initializing eww server. (/run/user/1000/eww-server_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==)
Run `eww logs` to see any errors while editing your configuration.
 2021-09-25T21:21:44.575Z INFO  eww::server > Loading paths: config-dir: /home/uncomfy/.config/eww, ipc-socket: /run/user/1000/eww-server_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==, log-file: /home/uncomfy/.cache/eww_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==.log

 $ cat .cache/eww_L2hvbWUvdW5jb21meS8uY29uZmlnL2V3dw==.log 

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛
uncomfyhalomacro commented 2 years ago

I forgot to mention, this only happens in musl. Works fine with glibc in void.

elkowar commented 2 years ago

Hmmmmmmm, I'm not all that familiar with the differences between glibc and musl in these contexts, but that's definitely weird. Any more hints at what could cause this would be appreciated, these types of edge-cases are somewhat outside of my area of expertise ^^

heavyrain266 commented 2 years ago

I'm able to use eww on musl (and freebsd libc), requires compiling gtk3 from source, some musl distros are shipping "shared packages" instead of rebuilding them. I'm using Carbs but even on Void with musl it was working fine for me.

AlphaNecron commented 2 years ago

I'm able to use eww on musl (and freebsd libc), requires compiling gtk3 from source, some musl distros are shipping "shared packages" instead of rebuilding them. I'm using Carbs but even on Void with musl it was working fine for me.

No need anyways, you just need to specify the target for cargo.

demostanis commented 2 years ago

Same issue here, running Void Linux with X, the /run/user/1000/eww-server_... file gets deleted after eww daemon

AlphaNecron commented 2 years ago

It runs fine for me tho.

TripleK2004 commented 2 years ago

Same issue here, running Void Linux with X, the /run/user/1000/eww-server_... file gets deleted after eww daemon

Can confirm that. So building gtk3 from source works ? as @HeavyRain266 said ? i will give it a try

TripleK2004 commented 2 years ago

I'm able to use eww on musl (and freebsd libc), requires compiling gtk3 from source, some musl distros are shipping "shared packages" instead of rebuilding them. I'm using Carbs but even on Void with musl it was working fine for me.

So i built gtk3 referring the PKGBUILD from AUR on void musl , eww still doesnt create the socket , or it gets deleted right after Should I remove the gtk3 system package ? Since its getting overwritten it should be fine Please provide more info this

AlphaNecron commented 2 years ago

GTK3 doesn't matter, you need to build eww from source with musl toolchain, right on the target machine.

TripleK2004 commented 2 years ago

GTK3 doesn't matter, you need to build eww from source with musl toolchain, right on the target machine.

And thats exactly what i did. How else would the binary even run for me to report Perhaps this can help me https://github.com/elkowar/eww/issues/362#issuecomment-1034152683

EDIT1 : Perhaps thats not exactly what i did Building with cargo build --target=x86_64-unknown-linux-musl --release --no-default-features worked

elkowar commented 2 years ago

So does this just work? Or is there still anyone having issues when specifying the target explicitly

AlphaNecron commented 2 years ago

It works for me, but not sure about others.

mitinarseny commented 2 years ago

Does not work for me...

~/dev/eww master
λ cargo +nightly build --target=x86_64-unknown-linux-musl --release --no-default-features --features=wayland
    Finished release [optimized] target(s) in 0.11s

~/dev/eww master
λ ./target/x86_64-unknown-linux-musl/release/eww daemon --no-daemonize --debug --logs
 2022-04-20T20:31:22.787Z INFO  eww > Initializing Eww server. (/run/user/1000/eww-server_40f4f9eb22b88dd1)
 2022-04-20T20:31:22.787Z INFO  eww::server > Loading paths: config-dir: /home/mitinarseny/.config/eww, ipc-socket: /run/user/1000/eww-server_40f4f9eb22b88dd1, log-file: /home/mitinarseny/.cache/eww_40f4f9eb22b88dd1.log

┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛

zsh: segmentation fault  ./target/x86_64-unknown-linux-musl/release/eww daemon --no-daemonize --debug
Ogromny commented 2 years ago

Same segfault with kisslinux (musl too)

nekopsykose commented 2 years ago

just like in #362 , you need RUSTFLAGS="-C target-feature=-crt-static" if you are using a rustup toolchain for it to work correctly. neither is an eww issue, but more of a rustup default issue (the -musl toolchains default to +crt-static, which links musl statically, but the resulting binary is not actually static, so it also gets loaded by the musl loader, so there are 2 musls and it explodes in certain non-basic conditions (gtk::init, etc), or something like that.)