tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
83.75k stars 2.51k forks source link

xdg-open does not work in release artifacts produced by tauri-action #10617

Open ninjadev64 opened 2 months ago

ninjadev64 commented 2 months ago

Hey @FabianLars

3 different, but related, functions of my application do not work when using the AppImage of my application produced by tauri-action in GitHub Actions, but work in AppImages produced locally for myself and 3 other users (as well as other methods of running the application, such as cargo tauri dev or other packaging formats). On my system, at least, the .RPM produced by tauri-action seems to work, and it is only the .AppImage that does not work. This issue is possibly related to tauri-apps/tauri#6172.

  1. My application OpenDeck loads plugins, which then communicate by sending JSON events back and forth over a websocket. One such event is openUrl, which a plugin can send to open a URL in the user's browser, which OpenDeck handles using Tauri's shell::open (see here).

  2. OpenDeck also has a button to open its config directory in its settings tab, which, on Linux, uses xdg-open using std's Command inside a Tauri command.

  3. Additionally, OpenDeck's "starter pack" plugin has a "Run Command" action, in which users can input a command to run on key down and key up. The starter pack plugin is also written in Rust, and uses std's Command to implement this action.

For example, when pressing "open config directory" when using the AppImage from GitHub Actions, run with ./opendeck_2.0.0_amd64.AppImage, this is printed to the terminal that the AppImage was run from:

xdg-mime: no method available for querying MIME type of '/home/aman/.config/com.amansprojects.opendeck'
xdg-mime: mimetype argument missing
Try 'xdg-mime --help' for more information.
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: x-www-browser: command not found
XPCOMGlueLoad error for file /usr/lib64/firefox/libxul.so:
/usr/lib64/libproxy/libpxbackend-1.0.so: undefined symbol: g_once_init_leave_pointer
Couldn't load XPCOM.
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: iceweasel: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: seamonkey: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: mozilla: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: epiphany: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: konqueror: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: chromium: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: chromium-browser: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: google-chrome: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: www-browser: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: links2: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: elinks: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: links: command not found
/tmp/.mount_opendegOqUUe/usr/bin//xdg-open: line 882: lynx: command not found

and then it seems to finally find and open w3m on my system in the terminal in the correct directory, whereas it should open in Nautilus for me, as it does when running OpenDeck from different methods.

Or, when using the Run Command action with xdg-open https://example.com/, this is the stdout of the executed command:

XPCOMGlueLoad error for file /usr/lib64/firefox/libxul.so:
/usr/lib64/libproxy/libpxbackend-1.0.so: undefined symbol: g_once_init_leave_pointer
Couldn't load XPCOM.

OpenDeck is using the latest Tauri v1.7 and uses: tauri-apps/tauri-action@v0. I would appreciate some steps to follow to resolve this issue.

ninjadev64 commented 2 months ago

Oh, sorry for the ping, this was originally going to be a comment on another issue and I forgot to remove the ping.

ninjadev64 commented 2 months ago

Seems like there is some useful information in this comment.

ninjadev64 commented 1 month ago

Any update? Or some kind of manual fix?

Norbiros commented 1 month ago

I've also encountered a few issues with an app built using tauri-action:

But when I build app on my computer (tauri build) all problems are fixed...

ninjadev64 commented 1 month ago

Yeah, seems like the same symptoms. @FabianLars any update?