tauri icon indicating copy to clipboard operation
tauri copied to clipboard

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

Open nekename opened this issue 1 year ago • 5 comments

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.

nekename avatar Aug 08 '24 13:08 nekename

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

nekename avatar Aug 08 '24 13:08 nekename

Seems like there is some useful information in this comment.

nekename avatar Aug 08 '24 14:08 nekename

Any update? Or some kind of manual fix?

nekename avatar Aug 20 '24 14:08 nekename

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

  • Normal <a href= links in HTML to external sites (that open in browser) don't work
  • xdg-open produces a lot of errors:
xdg-mime: no method available for querying MIME type of '/home/norbi/.local/share/ModrinthApp/profiles/Main'
xdg-mime: mimetype argument missing
Try 'xdg-mime --help' for more information.
Opening "/home/norbi/.local/share/ModrinthApp/profiles/Main" with Files  (inode/directory)
nautilus: /tmp/.mount_modrin4YwviT/usr/lib/libjson-glib-1.0.so.0: no version information available (required by /usr/lib64/libtracker-sparql-3.0.so.0)
nautilus: symbol lookup error: /usr/lib64/libappstream.so.4: undefined symbol: g_string_free_and_steal
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: x-www-browser: command not found
XPCOMGlueLoad error for file /usr/lib64/firefox/libxul.so:
/usr/lib64/firefox/libxul.so: undefined symbol: pixman_image_set_dither
Couldn't load XPCOM.
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: iceweasel: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: seamonkey: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: mozilla: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: epiphany: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: konqueror: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: chromium: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: chromium-browser: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: google-chrome: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: www-browser: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: links2: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: elinks: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: links: command not found
/tmp/.mount_modrin4YwviT/usr/bin//xdg-open: line 869: lynx: command not found
xdg-open: no method available for opening '/home/norbi/.local/share/ModrinthApp/profiles/Main'

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

Norbiros avatar Aug 22 '24 09:08 Norbiros

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

nekename avatar Aug 23 '24 16:08 nekename

This looks related to https://github.com/AppImage/AppImageKit/issues/124 where an incorrectly set XDG_DATA_DIRS causes xdg-open to fail.

I tested on an appimage built by tauri and XDG_DATA_DIRS is set to /tmp/.mount_gale.auwH2Kd/usr/share/:/tmp/.mount_gale.auwH2Kd/usr/share:/usr/share:/home/deck/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share, where everything after the first :/usr/share: is the original XDG_DATA_DIRS.

arrowmaster avatar Aug 13 '25 20:08 arrowmaster