Skip to content

Commit eaf9669

Browse files
authored
fix(bundler): stop bundling xdg-open and xdg-utils (#15804)
1 parent b6c4aea commit eaf9669

4 files changed

Lines changed: 12 additions & 36 deletions

File tree

‎.changes/fix-appimage-xdg-utils.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
tauri-bundler: patch:bug
3+
tauri-cli: patch:bug
4+
"@tauri-apps/cli": patch:bug
5+
---
6+
7+
On Linux, do not bundle xdg-open and xdg-utils in the AppImage anymore. This rarely worked and usually requires host system support anyway.

‎crates/tauri-bundler/src/bundle/linux/appimage/linuxdeploy.rs‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use super::{super::debian, write_and_make_executable};
77
use crate::{
88
bundle::settings::Arch,
9-
error::{Context, ErrorExt},
9+
error::Context,
1010
utils::{fs_utils, http_utils::download, CommandExt},
1111
Settings,
1212
};
@@ -118,21 +118,6 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
118118
fs::create_dir_all(&app_dir_usr_bin)?;
119119
fs::create_dir_all(app_dir_usr_lib)?;
120120

121-
// Copy bins and libs that linuxdeploy doesn't know about
122-
123-
// we also check if the user may have provided their own copy already
124-
// xdg-open will be handled by the `files` config instead
125-
if settings.deep_link_protocols().is_some() && !app_dir_usr_bin.join("xdg-open").exists() {
126-
fs::copy("/usr/bin/xdg-mime", app_dir_usr_bin.join("xdg-mime"))
127-
.fs_context("xdg-mime binary not found", "/usr/bin/xdg-mime".to_string())?;
128-
}
129-
130-
// we also check if the user may have provided their own copy already
131-
if settings.appimage().bundle_xdg_open && !app_dir_usr_bin.join("xdg-open").exists() {
132-
fs::copy("/usr/bin/xdg-open", app_dir_usr_bin.join("xdg-open"))
133-
.fs_context("xdg-open binary not found", "/usr/bin/xdg-open".to_string())?;
134-
}
135-
136121
let search_dirs = [
137122
match settings.binary_arch() {
138123
Arch::X86_64 => "/usr/lib/x86_64-linux-gnu/",

‎crates/tauri-bundler/src/bundle/settings.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ pub struct AppImageSettings {
223223
/// Whether to include gstreamer plugins for audio/media support.
224224
pub bundle_media_framework: bool,
225225
/// Whether to include the `xdg-open` binary.
226+
#[deprecated(
227+
since = "2.12.0",
228+
note = "Bundling xdg-open in an AppImage does not work and therefore was disabled."
229+
)]
226230
pub bundle_xdg_open: bool,
227231
}
228232

‎crates/tauri-cli/src/interface/rust.rs‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -899,26 +899,6 @@ impl AppSettings for RustAppSettings {
899899
});
900900
}
901901

902-
if let Some(open) = config.plugins.0.get("shell").and_then(|v| v.get("open")) {
903-
if open.as_bool().is_some_and(|x| x) || open.is_string() {
904-
settings.appimage.bundle_xdg_open = true;
905-
}
906-
}
907-
908-
if let Some(deps) = self
909-
.manifest
910-
.lock()
911-
.unwrap()
912-
.inner
913-
.as_table()
914-
.get("dependencies")
915-
.and_then(|f| f.as_table())
916-
{
917-
if deps.contains_key("tauri-plugin-opener") {
918-
settings.appimage.bundle_xdg_open = true;
919-
};
920-
}
921-
922902
Ok(settings)
923903
}
924904

0 commit comments

Comments
 (0)