eww icon indicating copy to clipboard operation
eww copied to clipboard

Problem with starting eww under musl

Open mitinarseny opened this issue 3 years ago • 20 comments

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

mitinarseny avatar Aug 31 '21 19:08 mitinarseny

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?

legendofmiracles avatar Sep 01 '21 01:09 legendofmiracles

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?

Animeshz avatar Sep 01 '21 02:09 Animeshz

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.

mitinarseny avatar Sep 02 '21 11:09 mitinarseny

Read the eww documentation on Wayland specifically

snakedye avatar Sep 02 '21 12:09 snakedye

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 avatar Sep 25 '21 21:09 uncomfyhalomacro

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

uncomfyhalomacro avatar Sep 26 '21 14:09 uncomfyhalomacro

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 ^^

elkowar avatar Oct 23 '21 12:10 elkowar

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.

heavyrain266 avatar Oct 23 '21 21:10 heavyrain266

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.

AlphaNecron avatar Dec 28 '21 11:12 AlphaNecron

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

demostanis avatar Feb 01 '22 16:02 demostanis

It runs fine for me tho.

AlphaNecron avatar Feb 02 '22 03:02 AlphaNecron

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 avatar Mar 29 '22 13:03 TripleK2004

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

TripleK2004 avatar Mar 31 '22 02:03 TripleK2004

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

AlphaNecron avatar Mar 31 '22 10:03 AlphaNecron

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

TripleK2004 avatar Mar 31 '22 12:03 TripleK2004

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

elkowar avatar Apr 19 '22 11:04 elkowar

It works for me, but not sure about others.

AlphaNecron avatar Apr 20 '22 12:04 AlphaNecron

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

mitinarseny avatar Apr 20 '22 20:04 mitinarseny

Same segfault with kisslinux (musl too)

Ogromny avatar Jul 11 '22 13:07 Ogromny

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.)

nekopsykose avatar Jul 25 '22 06:07 nekopsykose