Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with starting eww under musl #253

Open
mitinarseny opened this issue Aug 31, 2021 · 20 comments
Open

Problem with starting eww under musl #253

mitinarseny opened this issue Aug 31, 2021 · 20 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mitinarseny
Copy link

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 #203 (comment)

@legendofmiracles
Copy link
Contributor

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
Copy link
Contributor

Animeshz commented Sep 1, 2021

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

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

println!(
r#"
┏━━━━━━━━━━━━━━━━━━━━━━━┓
┃Initializing eww daemon┃
┗━━━━━━━━━━━━━━━━━━━━━━━┛
"#
);
simple_signal::set_handler(&[simple_signal::Signal::Int, simple_signal::Signal::Term], move |_| {
log::info!("Shutting down eww daemon...");
if let Err(e) = crate::application_lifecycle::send_exit() {
log::error!("Failed to send application shutdown event to workers: {:?}", e);
std::process::exit(1);
}
});
gtk::init()?;
log::debug!("Initializing script var handler");
let script_var_handler = script_var_handler::init(ui_send.clone());

Which distro you are using, does it have gtk?

@mitinarseny
Copy link
Author

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
Copy link
Contributor

snakedye commented Sep 2, 2021

Read the eww documentation on Wayland specifically

@uncomfyhalomacro
Copy link

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
Copy link

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

@elkowar
Copy link
Owner

elkowar commented Oct 23, 2021

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 elkowar changed the title Problem with starting eww Problem with starting eww under musl Oct 23, 2021
@elkowar elkowar added bug Something isn't working help wanted Extra attention is needed labels Oct 23, 2021
@heavyrain266
Copy link

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
Copy link

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
Copy link

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

@AlphaNecron
Copy link

It runs fine for me tho.

@TripleK2004
Copy link

TripleK2004 commented Mar 29, 2022

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
Copy link

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
Copy link

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

@TripleK2004
Copy link

TripleK2004 commented Mar 31, 2022

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 #362 (comment)

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

@elkowar
Copy link
Owner

elkowar commented Apr 19, 2022

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

@AlphaNecron
Copy link

It works for me, but not sure about others.

@mitinarseny
Copy link
Author

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
Copy link

Ogromny commented Jul 11, 2022

Same segfault with kisslinux (musl too)

@nekopsykose
Copy link

nekopsykose commented Jul 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests