waycrate / xdg-desktop-portal-luminous

A xdg-desktop-portal for wlroots based compositors implementing zwlr_screencopy. Written by @decodetalkers
GNU General Public License v3.0
30 stars 5 forks source link

Fails to start without config directory #14

Closed jbeich closed 9 months ago

jbeich commented 9 months ago

While Luminous portal works fine without config file it fails when the directory is also missing like on the first start by a new user or inside jail/sandbox. Found while packaging and testing in a pristine environment.

$ rm -rf ~/.config/xdg-desktop-portal-luminous/
$ RUST_BACKTRACE=1 /usr/libexec/xdg-desktop-portal-luminous
INFO xdg_desktop_portal_luminous: luminous Start
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Generic("No such file or directory (os error 2)"), paths: [] }', src/main.rs:137:46
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: xdg_desktop_portal_luminous::main::{{closure}}::{{closure}}
   4: tokio::runtime::task::raw::poll
   5: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
   6: tokio::runtime::task::raw::poll
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Abort trap
Shinyzenith commented 9 months ago

Hi! thanks for the report. I'm currently away from my workstation as I'm travelling.

@Decodetalkers would you mind taking a look? If you happen to be busy, I can take a look at it.

Decodetalkers commented 9 months ago

It is because filewatcher, it shouldn't unwrap there..that place should check result and make log,

Decodetalkers commented 9 months ago

Fixed, I will make a new tag

jbeich commented 9 months ago

v0.1.2 still fails but now instead of aborting on startup it shows black screen and spams luminous Start (at least 10 times). Tested via OBS Studio.

jbeich commented 9 months ago

According to export PIPEWIRE_DEBUG=5 nothing happens after xdg-desktop-portal-luminous prints Maybe file is not exist line

Decodetalkers commented 9 months ago

According to export PIPEWIRE_DEBUG=5 nothing happens after xdg-desktop-portal-luminous prints Maybe file is not exist line

Stop the service and directly run the program. I have already handled all unwrap. /usr/lib/xdg-desktop-protal-liminous

Decodetalkers commented 9 months ago

Ok, I see, it is the problem of the filewatcher thread.. interesting

Decodetalkers commented 9 months ago

ha, I see,I move conn to async watch, and if it exit, it is droped

Decodetalkers commented 9 months ago

so I fixed it.. because add fswatcher, I move it to another tokio thread, then it is droped, so let me thought of make it static, but 0.1.3 fixed it

jbeich commented 9 months ago

0.1.4 (didn't test 0.1.3) appears to work fine.