From 251203b8963419cb3b40741767393e8f3c909ef9 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:05:12 +0800 Subject: [PATCH 1/9] fix(linux): work area returns logical rect (#14637) --- .changes/linux-workarea-logical-size.md | 6 ++++++ crates/tauri-runtime-wry/src/monitor/linux.rs | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changes/linux-workarea-logical-size.md diff --git a/.changes/linux-workarea-logical-size.md b/.changes/linux-workarea-logical-size.md new file mode 100644 index 000000000..a151910f6 --- /dev/null +++ b/.changes/linux-workarea-logical-size.md @@ -0,0 +1,6 @@ +--- +tauri: patch:bug +tauri-runtime-wry: patch:bug +--- + +Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux diff --git a/crates/tauri-runtime-wry/src/monitor/linux.rs b/crates/tauri-runtime-wry/src/monitor/linux.rs index 6b6a33bce..62f87eb05 100644 --- a/crates/tauri-runtime-wry/src/monitor/linux.rs +++ b/crates/tauri-runtime-wry/src/monitor/linux.rs @@ -4,14 +4,15 @@ use gtk::prelude::MonitorExt; use tao::platform::unix::MonitorHandleExtUnix; -use tauri_runtime::dpi::{PhysicalPosition, PhysicalRect, PhysicalSize}; +use tauri_runtime::dpi::{LogicalPosition, LogicalSize, PhysicalRect}; impl super::MonitorExt for tao::monitor::MonitorHandle { fn work_area(&self) -> PhysicalRect { let rect = self.gdk_monitor().workarea(); + let scale_factor = self.scale_factor(); PhysicalRect { - size: PhysicalSize::new(rect.width() as u32, rect.height() as u32), - position: PhysicalPosition::new(rect.x(), rect.y()), + size: LogicalSize::new(rect.width() as u32, rect.height() as u32).to_physical(scale_factor), + position: LogicalPosition::new(rect.x(), rect.y()).to_physical(scale_factor), } } } From 54e8d93db1278e4bd3e9e1ae57ecb4ac1b4f63cd Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 9 Dec 2025 12:11:53 +0100 Subject: [PATCH 2/9] ci(renovate): group worker-rs updates --- renovate.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renovate.json b/renovate.json index 016c0c807..3f55df977 100644 --- a/renovate.json +++ b/renovate.json @@ -29,6 +29,11 @@ "https://github.com/microsoft/windows-rs", "https://github.com/wravery/webview2-rs" ] + }, + { + "description": "Group worker-rs crates", + "groupName": "worker-rs crates", + "matchSourceUrls": ["https://github.com/cloudflare/workers-rs"] } ], "postUpdateOptions": ["pnpmDedupe"] From f2e0405dc2d8bae949de6bb5e479bbf3cde401b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:41:05 +0100 Subject: [PATCH 3/9] apply version updates (#14592) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changes/bump-version-num-bigint-dig.md | 5 ----- .changes/linux-workarea-logical-size.md | 6 ------ .changes/no-sign-skip-nsis-uninstaller.md | 5 ----- .changes/nsis-plugin-sign-path.md | 5 ----- .changes/support-template-extensions.md | 5 ----- .changes/version-req-error.md | 5 ----- Cargo.lock | 16 ++++++++-------- crates/tauri-bundler/CHANGELOG.md | 15 +++++++++++++++ crates/tauri-bundler/Cargo.toml | 4 ++-- crates/tauri-cli/CHANGELOG.md | 11 +++++++++++ crates/tauri-cli/Cargo.toml | 6 +++--- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-cli/metadata-v2.json | 4 ++-- crates/tauri-macos-sign/CHANGELOG.md | 6 ++++++ crates/tauri-macos-sign/Cargo.toml | 2 +- crates/tauri-runtime-wry/CHANGELOG.md | 6 ++++++ crates/tauri-runtime-wry/Cargo.toml | 2 +- .../schemas/config.schema.json | 2 +- crates/tauri/CHANGELOG.md | 10 ++++++++++ crates/tauri/Cargo.toml | 4 ++-- packages/cli/CHANGELOG.md | 6 ++++++ packages/cli/package.json | 2 +- 22 files changed, 76 insertions(+), 53 deletions(-) delete mode 100644 .changes/bump-version-num-bigint-dig.md delete mode 100644 .changes/linux-workarea-logical-size.md delete mode 100644 .changes/no-sign-skip-nsis-uninstaller.md delete mode 100644 .changes/nsis-plugin-sign-path.md delete mode 100644 .changes/support-template-extensions.md delete mode 100644 .changes/version-req-error.md diff --git a/.changes/bump-version-num-bigint-dig.md b/.changes/bump-version-num-bigint-dig.md deleted file mode 100644 index 5b7214e58..000000000 --- a/.changes/bump-version-num-bigint-dig.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-macos-sign": patch:deps ---- - -Update num-bigint-dig from 0.8.4 to 0.8.6 \ No newline at end of file diff --git a/.changes/linux-workarea-logical-size.md b/.changes/linux-workarea-logical-size.md deleted file mode 100644 index a151910f6..000000000 --- a/.changes/linux-workarea-logical-size.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -tauri: patch:bug -tauri-runtime-wry: patch:bug ---- - -Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux diff --git a/.changes/no-sign-skip-nsis-uninstaller.md b/.changes/no-sign-skip-nsis-uninstaller.md deleted file mode 100644 index 3e7952d93..000000000 --- a/.changes/no-sign-skip-nsis-uninstaller.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:bug ---- - -Skip signing for NSIS uninstaller when using `--no-sign` flag diff --git a/.changes/nsis-plugin-sign-path.md b/.changes/nsis-plugin-sign-path.md deleted file mode 100644 index 99f4f6861..000000000 --- a/.changes/nsis-plugin-sign-path.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:bug ---- - -Fix NSIS plugins not being signed due to wrong path handlings diff --git a/.changes/support-template-extensions.md b/.changes/support-template-extensions.md deleted file mode 100644 index 8fa4654c9..000000000 --- a/.changes/support-template-extensions.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:enhance ---- - -Consider extensions that are defined in the wxs template. diff --git a/.changes/version-req-error.md b/.changes/version-req-error.md deleted file mode 100644 index 902151b34..000000000 --- a/.changes/version-req-error.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-cli: patch:changes ---- - -Errors like `Error Failed to parse version 2 for for NPM package tauri` when there was no `package-lock.json` file present yet or when using ones like `link:./tauri` are now only logged in `--verbose` mode. diff --git a/Cargo.lock b/Cargo.lock index 407c0f444..d571d8aae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -4319,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -8493,7 +8493,7 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.9.4" +version = "2.9.5" dependencies = [ "anyhow", "bytes", @@ -8575,7 +8575,7 @@ dependencies = [ [[package]] name = "tauri-bundler" -version = "2.7.4" +version = "2.7.5" dependencies = [ "anyhow", "ar", @@ -8621,7 +8621,7 @@ dependencies = [ [[package]] name = "tauri-cli" -version = "2.9.5" +version = "2.9.6" dependencies = [ "ar", "axum", @@ -8781,7 +8781,7 @@ dependencies = [ [[package]] name = "tauri-macos-sign" -version = "2.3.1" +version = "2.3.2" dependencies = [ "apple-codesign", "chrono", @@ -8884,7 +8884,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.9.2" +version = "2.9.3" dependencies = [ "gtk", "http 1.3.1", @@ -10323,7 +10323,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/tauri-bundler/CHANGELOG.md b/crates/tauri-bundler/CHANGELOG.md index 0ae31a2bd..c8e880524 100644 --- a/crates/tauri-bundler/CHANGELOG.md +++ b/crates/tauri-bundler/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## \[2.7.5] + +### Enhancements + +- [`4176f93ae`](https://www.github.com/tauri-apps/tauri/commit/4176f93ae43ef66714c4934feb3df19df3a3e28a) ([#14570](https://www.github.com/tauri-apps/tauri/pull/14570) by [@chfaft](https://www.github.com/tauri-apps/tauri/../../chfaft)) Consider extensions that are defined in the wxs template. + +### Bug Fixes + +- [`018b4db22`](https://www.github.com/tauri-apps/tauri/commit/018b4db22e167fa67b37b0933e192a0f3556d3e5) ([#14625](https://www.github.com/tauri-apps/tauri/pull/14625) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Skip signing for NSIS uninstaller when using `--no-sign` flag +- [`91becd9e4`](https://www.github.com/tauri-apps/tauri/commit/91becd9e4fa2db089ddc6b21dadc06133e939e08) ([#14627](https://www.github.com/tauri-apps/tauri/pull/14627) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix NSIS plugins not being signed due to wrong path handlings + +### Dependencies + +- Upgraded to `tauri-macos-sign@2.3.2` + ## \[2.7.4] ### Bug Fixes diff --git a/crates/tauri-bundler/Cargo.toml b/crates/tauri-bundler/Cargo.toml index 351b072ed..cb88cb9a9 100644 --- a/crates/tauri-bundler/Cargo.toml +++ b/crates/tauri-bundler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-bundler" -version = "2.7.4" +version = "2.7.5" authors = [ "George Burton ", "Tauri Programme within The Commons Conservancy", @@ -59,7 +59,7 @@ features = ["Win32_System_SystemInformation", "Win32_System_Diagnostics_Debug"] [target."cfg(target_os = \"macos\")".dependencies] icns = { package = "tauri-icns", version = "0.1" } time = { version = "0.3", features = ["formatting"] } -tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.2", path = "../tauri-macos-sign" } [target."cfg(target_os = \"linux\")".dependencies] heck = "0.5" diff --git a/crates/tauri-cli/CHANGELOG.md b/crates/tauri-cli/CHANGELOG.md index ba3f2baf5..cb3bc6716 100644 --- a/crates/tauri-cli/CHANGELOG.md +++ b/crates/tauri-cli/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## \[2.9.6] + +### What's Changed + +- [`7b1b3514d`](https://www.github.com/tauri-apps/tauri/commit/7b1b3514df771e6e9859b9f54fa4df332433948e) ([#14621](https://www.github.com/tauri-apps/tauri/pull/14621) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Errors like `Error Failed to parse version 2 for for NPM package tauri` when there was no `package-lock.json` file present yet or when using ones like `link:./tauri` are now only logged in `--verbose` mode. + +### Dependencies + +- Upgraded to `tauri-macos-sign@2.3.2` +- Upgraded to `tauri-bundler@2.7.5` + ## \[2.9.5] ### Bug Fixes diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 89d2ead0c..cbd4bebf6 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-cli" -version = "2.9.5" +version = "2.9.6" authors = ["Tauri Programme within The Commons Conservancy"] edition = "2021" rust-version = "1.77.2" @@ -47,7 +47,7 @@ sublime_fuzzy = "0.7" clap_complete = "4" clap = { version = "4", features = ["derive", "env"] } thiserror = "2" -tauri-bundler = { version = "2.7.4", default-features = false, path = "../tauri-bundler" } +tauri-bundler = { version = "2.7.5", default-features = false, path = "../tauri-bundler" } colored = "2" serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } @@ -133,7 +133,7 @@ libc = "0.2" [target."cfg(target_os = \"macos\")".dependencies] plist = "1" -tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.2", path = "../tauri-macos-sign" } object = { version = "0.36", default-features = false, features = [ "macho", "read_core", diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index c71bf6e2d..4ccf34d1b 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.4", + "$id": "https://schema.tauri.app/config/2.9.5", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri-cli/metadata-v2.json b/crates/tauri-cli/metadata-v2.json index b57586d4a..510949b94 100644 --- a/crates/tauri-cli/metadata-v2.json +++ b/crates/tauri-cli/metadata-v2.json @@ -1,9 +1,9 @@ { "cli.js": { - "version": "2.9.5", + "version": "2.9.6", "node": ">= 10.0.0" }, - "tauri": "2.9.4", + "tauri": "2.9.5", "tauri-build": "2.5.3", "tauri-plugin": "2.5.2" } diff --git a/crates/tauri-macos-sign/CHANGELOG.md b/crates/tauri-macos-sign/CHANGELOG.md index 6da5a62a8..6cccf2a3e 100644 --- a/crates/tauri-macos-sign/CHANGELOG.md +++ b/crates/tauri-macos-sign/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.3.2] + +### Dependencies + +- [`514cf21e1`](https://www.github.com/tauri-apps/tauri/commit/514cf21e1417c7a78a0db494f891ba79d948b73d) ([#14591](https://www.github.com/tauri-apps/tauri/pull/14591) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) Update num-bigint-dig from 0.8.4 to 0.8.6 + ## \[2.3.1] ### Performance Improvements diff --git a/crates/tauri-macos-sign/Cargo.toml b/crates/tauri-macos-sign/Cargo.toml index 620c3f750..9fc874364 100644 --- a/crates/tauri-macos-sign/Cargo.toml +++ b/crates/tauri-macos-sign/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-macos-sign" -version = "2.3.1" +version = "2.3.2" authors = ["Tauri Programme within The Commons Conservancy"] license = "Apache-2.0 OR MIT" keywords = ["codesign", "signing", "macos", "ios", "tauri"] diff --git a/crates/tauri-runtime-wry/CHANGELOG.md b/crates/tauri-runtime-wry/CHANGELOG.md index 2fee3f822..76f0a046f 100644 --- a/crates/tauri-runtime-wry/CHANGELOG.md +++ b/crates/tauri-runtime-wry/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.3] + +### Bug Fixes + +- [`251203b89`](https://www.github.com/tauri-apps/tauri/commit/251203b8963419cb3b40741767393e8f3c909ef9) ([#14637](https://www.github.com/tauri-apps/tauri/pull/14637) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux + ## \[2.9.2] ### Dependencies diff --git a/crates/tauri-runtime-wry/Cargo.toml b/crates/tauri-runtime-wry/Cargo.toml index 3284cddbd..339b07f4a 100644 --- a/crates/tauri-runtime-wry/Cargo.toml +++ b/crates/tauri-runtime-wry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime-wry" -version = "2.9.2" +version = "2.9.3" description = "Wry bindings to the Tauri runtime" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index c71bf6e2d..4ccf34d1b 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.4", + "$id": "https://schema.tauri.app/config/2.9.5", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri/CHANGELOG.md b/crates/tauri/CHANGELOG.md index d4b868f5e..ea3c1568c 100644 --- a/crates/tauri/CHANGELOG.md +++ b/crates/tauri/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## \[2.9.5] + +### Bug Fixes + +- [`251203b89`](https://www.github.com/tauri-apps/tauri/commit/251203b8963419cb3b40741767393e8f3c909ef9) ([#14637](https://www.github.com/tauri-apps/tauri/pull/14637) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux + +### Dependencies + +- Upgraded to `tauri-runtime-wry@2.9.3` + ## \[2.9.4] ### Performance Improvements diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index 48336f82a..4da7736cd 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri" -version = "2.9.4" +version = "2.9.5" description = "Make tiny, secure apps for all desktop platforms with Tauri" exclude = ["/test", "/.scripts", "CHANGELOG.md", "/target"] readme = "README.md" @@ -60,7 +60,7 @@ tauri-macros = { version = "2.5.2", path = "../tauri-macros" } tauri-utils = { version = "2.8.1", features = [ "resources", ], path = "../tauri-utils" } -tauri-runtime-wry = { version = "2.9.2", path = "../tauri-runtime-wry", default-features = false, optional = true } +tauri-runtime-wry = { version = "2.9.3", path = "../tauri-runtime-wry", default-features = false, optional = true } getrandom = "0.3" serde_repr = "0.1" http = "1" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 669c6b313..305a65a38 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.6] + +### Dependencies + +- Upgraded to `tauri-cli@2.9.6` + ## \[2.9.5] ### Bug Fixes diff --git a/packages/cli/package.json b/packages/cli/package.json index 0d2bf618c..f6dce72a9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/cli", - "version": "2.9.5", + "version": "2.9.6", "description": "Command line interface for building Tauri apps", "type": "commonjs", "funding": { From 18c69df8c771885533c324eece3004c44311aa9c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 13:42:27 +0100 Subject: [PATCH 4/9] chore(deps): update worker-rs crates to 0.7 (#14638) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars --- Cargo.lock | 77 ++++++++---------------- crates/tauri-schema-worker/Cargo.toml | 4 +- crates/tauri-schema-worker/wrangler.toml | 3 +- 3 files changed, 28 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d571d8aae..9dae76c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3968,9 +3968,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -4319,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -10062,35 +10062,22 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.95", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -10101,9 +10088,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10111,22 +10098,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn 2.0.95", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] @@ -10146,9 +10133,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -10323,7 +10310,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -10868,9 +10855,9 @@ dependencies = [ [[package]] name = "worker" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6ac1566a3005b790b974f0621d77431e2a47e5f481276485f5ac0485775de2" +checksum = "42c76c5889873a2c309365ad4503810c007d3c25fbb4e9fa9e4e23c4ceb3c7f2" dependencies = [ "async-trait", "axum", @@ -10893,31 +10880,15 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "worker-kv", "worker-macros", "worker-sys", ] -[[package]] -name = "worker-kv" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d30eb90e8db0657414129624c0d12c6cb480574bc2ddd584822db196cb9a52" -dependencies = [ - "js-sys", - "serde", - "serde-wasm-bindgen", - "serde_json", - "thiserror 2.0.12", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "worker-macros" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba7478759843ae3d56dc7ba2445e7a514a5d043eaa98cebac2789f7ab5221ee" +checksum = "62c62584d037bad33789a6a5d605b3fccea1c52de9251d06f9d44054170dc612" dependencies = [ "async-trait", "proc-macro2", @@ -10931,9 +10902,9 @@ dependencies = [ [[package]] name = "worker-sys" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb4d7a3273dd584b9526aec77bbcf815c51d1a0e17407b1a390cf5a39b6d4fbd" +checksum = "72ddd412fd62c6eeffc1dd85e6ae5960a33b534f44a733df75b6e7519972bc74" dependencies = [ "cfg-if", "js-sys", diff --git a/crates/tauri-schema-worker/Cargo.toml b/crates/tauri-schema-worker/Cargo.toml index 70462e5f9..34da45cc7 100644 --- a/crates/tauri-schema-worker/Cargo.toml +++ b/crates/tauri-schema-worker/Cargo.toml @@ -8,8 +8,8 @@ publish = false crate-type = ["cdylib"] [dependencies] -worker = { version = "0.6", features = ['http', 'axum'] } -worker-macros = { version = "0.6", features = ['http'] } +worker = { version = "0.7", features = ['http', 'axum'] } +worker-macros = { version = "0.7", features = ['http'] } console_error_panic_hook = { version = "0.1" } axum = { version = "0.8", default-features = false } tower-service = "0.3" diff --git a/crates/tauri-schema-worker/wrangler.toml b/crates/tauri-schema-worker/wrangler.toml index c7b811908..661b6059a 100644 --- a/crates/tauri-schema-worker/wrangler.toml +++ b/crates/tauri-schema-worker/wrangler.toml @@ -7,8 +7,9 @@ main = "build/worker/shim.mjs" compatibility_date = "2023-08-23" send_metrics = false +# The minor version of worker-build must match worker/worker-macros in Cargo.toml! [build] -command = "cargo install -q worker-build && worker-build --release" +command = "cargo install -q worker-build@^0.7 && worker-build --release" [observability] enabled = true From 2d28e3143ee3d97d7570ea03877aa00a0d6e47d0 Mon Sep 17 00:00:00 2001 From: sftse Date: Tue, 9 Dec 2025 14:38:14 +0100 Subject: [PATCH 5/9] Cleanups (#14632) * refactor(tauri-utils): current_dest and current_pattern always change in-sync, group them to one Option * refactor(tauri-utils): pass path as explicit argument instead of implicitly through self * refactor(tauri-utils): remove struct field that is never set to Some * refactor(tauri-cli): use OsString, OsStr where possible * refactor(tauri-cli): Deref Arc early * refactor(tauri-cli): lock config before passing to build::setup() * refactor(tauri-build, tauri-utils): bettern pattern matching and borrowing * refactor(tauri-cli): dont need Arc if already have static * fix(tauri-cli): race condition initializing static flag, remove unnecessary OnceLock * refactor(tauri-cli): use expect * refactor(tauri-cli): remove unnecessary OnceLock * refactor(tauri-cli): better use of dunce api * refactor(tauri-cli): rename --- .changes/change-pr-14632.md | 7 +++ crates/tauri-build/src/lib.rs | 16 +++---- .../tauri-bundler/src/bundle/windows/sign.rs | 3 +- crates/tauri-cli/src/build.rs | 39 +++++++-------- crates/tauri-cli/src/bundle.rs | 4 +- crates/tauri-cli/src/dev.rs | 16 +++---- crates/tauri-cli/src/helpers/app_paths.rs | 16 ++----- crates/tauri-cli/src/helpers/config.rs | 35 +++++++------- crates/tauri-cli/src/mobile/android/build.rs | 7 ++- crates/tauri-cli/src/mobile/android/dev.rs | 2 +- crates/tauri-cli/src/mobile/ios/build.rs | 7 ++- crates/tauri-utils/src/config/parse.rs | 2 +- crates/tauri-utils/src/platform.rs | 12 ++--- crates/tauri-utils/src/resources.rs | 47 +++++-------------- 14 files changed, 89 insertions(+), 124 deletions(-) create mode 100644 .changes/change-pr-14632.md diff --git a/.changes/change-pr-14632.md b/.changes/change-pr-14632.md new file mode 100644 index 000000000..068994f0d --- /dev/null +++ b/.changes/change-pr-14632.md @@ -0,0 +1,7 @@ +--- +"tauri-utils": patch:enhance +"tauri-build": patch:enhance +"tauri-cli": patch:enhance +--- + +Small code refactors for improved code readability. No user facing changes. diff --git a/crates/tauri-build/src/lib.rs b/crates/tauri-build/src/lib.rs index cd9724252..42c9275b4 100644 --- a/crates/tauri-build/src/lib.rs +++ b/crates/tauri-build/src/lib.rs @@ -165,21 +165,21 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> { .with_context(|| format!("Failed to create frameworks output directory at {dest_dir:?}"))?; for framework in frameworks.iter() { if framework.ends_with(".framework") { - let src_path = PathBuf::from(framework); + let src_path = Path::new(framework); let src_name = src_path .file_name() .expect("Couldn't get framework filename"); let dest_path = dest_dir.join(src_name); - copy_dir(&src_path, &dest_path)?; + copy_dir(src_path, &dest_path)?; continue; } else if framework.ends_with(".dylib") { - let src_path = PathBuf::from(framework); + let src_path = Path::new(framework); if !src_path.exists() { return Err(anyhow::anyhow!("Library not found: {}", framework)); } let src_name = src_path.file_name().expect("Couldn't get library filename"); let dest_path = dest_dir.join(src_name); - copy_file(&src_path, &dest_path)?; + copy_file(src_path, &dest_path)?; continue; } else if framework.contains('/') { return Err(anyhow::anyhow!( @@ -192,12 +192,8 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> { continue; } } - if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)? - || copy_framework_from( - &PathBuf::from("/Network/Library/Frameworks/"), - framework, - dest_dir, - )? + if copy_framework_from("/Library/Frameworks/".as_ref(), framework, dest_dir)? + || copy_framework_from("/Network/Library/Frameworks/".as_ref(), framework, dest_dir)? { continue; } diff --git a/crates/tauri-bundler/src/bundle/windows/sign.rs b/crates/tauri-bundler/src/bundle/windows/sign.rs index 04e5a2da5..f7c7ad1e2 100644 --- a/crates/tauri-bundler/src/bundle/windows/sign.rs +++ b/crates/tauri-bundler/src/bundle/windows/sign.rs @@ -266,8 +266,7 @@ pub fn try_sign>(file_path: P, settings: &Settings) -> crate::Res pub fn should_sign(file_path: &Path) -> crate::Result { let is_binary = file_path .extension() - .and_then(|extension| extension.to_str()) - .is_some_and(|extension| matches!(extension, "exe" | "dll")); + .is_some_and(|ext| ext == "exe" || ext == "dll"); if !is_binary { return Ok(false); } diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index 12accb16f..ac8c5552a 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -8,7 +8,7 @@ use crate::{ helpers::{ self, app_paths::{frontend_dir, tauri_dir}, - config::{get as get_config, ConfigHandle, FrontendDist}, + config::{get as get_config, ConfigMetadata, FrontendDist}, }, info::plugins::check_mismatched_packages, interface::{rust::get_cargo_target_dir, AppInterface, Interface}, @@ -106,11 +106,11 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { options.target.clone(), )?; - setup(&interface, &mut options, config.clone(), false)?; - let config_guard = config.lock().unwrap(); let config_ = config_guard.as_ref().unwrap(); + setup(&interface, &mut options, config_, false)?; + if let Some(minimum_system_version) = &config_.bundle.macos.minimum_system_version { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); } @@ -132,7 +132,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { verbosity, ci, &interface, - &app_settings, + &*app_settings, config_, &out_dir, )?; @@ -144,7 +144,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { pub fn setup( interface: &AppInterface, options: &mut Options, - config: ConfigHandle, + config: &ConfigMetadata, mobile: bool, ) -> Result<()> { let tauri_path = tauri_dir(); @@ -162,44 +162,39 @@ pub fn setup( set_current_dir(tauri_path).context("failed to set current directory")?; - let config_guard = config.lock().unwrap(); - let config_ = config_guard.as_ref().unwrap(); - - let bundle_identifier_source = config_ + let bundle_identifier_source = config .find_bundle_identifier_overwriter() .unwrap_or_else(|| "tauri.conf.json".into()); - if config_.identifier == "com.tauri.dev" { + if config.identifier == "com.tauri.dev" { crate::error::bail!( "You must change the bundle identifier in `{bundle_identifier_source} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.", ); } - if config_ + if config .identifier .chars() .any(|ch| !(ch.is_alphanumeric() || ch == '-' || ch == '.')) { crate::error::bail!( - "The bundle identifier \"{}\" set in `{} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", - config_.identifier, - bundle_identifier_source + "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", + config.identifier, ); } - if config_.identifier.ends_with(".app") { + if config.identifier.ends_with(".app") { log::warn!( - "The bundle identifier \"{}\" set in `{} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.", - config_.identifier, - bundle_identifier_source + "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.", + config.identifier, ); } - if let Some(before_build) = config_.build.before_build_command.clone() { + if let Some(before_build) = config.build.before_build_command.clone() { helpers::run_hook("beforeBuildCommand", before_build, interface, options.debug)?; } - if let Some(FrontendDist::Directory(web_asset_path)) = &config_.build.frontend_dist { + if let Some(FrontendDist::Directory(web_asset_path)) = &config.build.frontend_dist { if !web_asset_path.exists() { let absolute_path = web_asset_path .parent() @@ -252,13 +247,13 @@ pub fn setup( } if options.runner.is_none() { - options.runner = config_.build.runner.clone(); + options.runner = config.build.runner.clone(); } options .features .get_or_insert(Vec::new()) - .extend(config_.build.features.clone().unwrap_or_default()); + .extend(config.build.features.clone().unwrap_or_default()); interface.build_options(&mut options.args, &mut options.features, mobile); Ok(()) diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index 890386cd7..646f44ddb 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -158,7 +158,7 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { verbosity, ci, &interface, - &app_settings, + &*app_settings, config_, &out_dir, ) @@ -170,7 +170,7 @@ pub fn bundle( verbosity: u8, ci: bool, interface: &AppInterface, - app_settings: &std::sync::Arc, + app_settings: &A, config: &ConfigMetadata, out_dir: &Path, ) -> crate::Result<()> { diff --git a/crates/tauri-cli/src/dev.rs b/crates/tauri-cli/src/dev.rs index 9179e9cfd..7ebabb458 100644 --- a/crates/tauri-cli/src/dev.rs +++ b/crates/tauri-cli/src/dev.rs @@ -34,7 +34,7 @@ use std::{ mod builtin_dev_server; static BEFORE_DEV: OnceLock>> = OnceLock::new(); -static KILL_BEFORE_DEV_FLAG: OnceLock = OnceLock::new(); +static KILL_BEFORE_DEV_FLAG: AtomicBool = AtomicBool::new(false); #[cfg(unix)] const KILL_CHILDREN_SCRIPT: &[u8] = include_bytes!("../scripts/kill-children.sh"); @@ -218,14 +218,13 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand let status = child_ .wait() .expect("failed to wait on \"beforeDevCommand\""); - if !(status.success() || KILL_BEFORE_DEV_FLAG.get().unwrap().load(Ordering::Relaxed)) { + if !(status.success() || KILL_BEFORE_DEV_FLAG.load(Ordering::Relaxed)) { log::error!("The \"beforeDevCommand\" terminated with a non-zero status code."); exit(status.code().unwrap_or(1)); } }); BEFORE_DEV.set(Mutex::new(child)).unwrap(); - KILL_BEFORE_DEV_FLAG.set(AtomicBool::default()).unwrap(); let _ = ctrlc::set_handler(move || { kill_before_dev_process(); @@ -304,12 +303,10 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand if !options.no_dev_server_wait { if let Some(url) = dev_url { - let host = url - .host() - .unwrap_or_else(|| panic!("No host name in the URL")); + let host = url.host().expect("No host name in the URL"); let port = url .port_or_known_default() - .unwrap_or_else(|| panic!("No port number in the URL")); + .expect("No port number in the URL"); let addrs; let addr; let addrs = match host { @@ -380,11 +377,10 @@ pub fn on_app_exit(code: Option, reason: ExitReason, exit_on_panic: bool, n pub fn kill_before_dev_process() { if let Some(child) = BEFORE_DEV.get() { let child = child.lock().unwrap(); - let kill_before_dev_flag = KILL_BEFORE_DEV_FLAG.get().unwrap(); - if kill_before_dev_flag.load(Ordering::Relaxed) { + if KILL_BEFORE_DEV_FLAG.load(Ordering::Relaxed) { return; } - kill_before_dev_flag.store(true, Ordering::Relaxed); + KILL_BEFORE_DEV_FLAG.store(true, Ordering::Relaxed); #[cfg(windows)] { let powershell_path = std::env::var("SYSTEMROOT").map_or_else( diff --git a/crates/tauri-cli/src/helpers/app_paths.rs b/crates/tauri-cli/src/helpers/app_paths.rs index 1bf1ef9b5..3c728f5ba 100644 --- a/crates/tauri-cli/src/helpers/app_paths.rs +++ b/crates/tauri-cli/src/helpers/app_paths.rs @@ -75,21 +75,13 @@ fn lookup bool>(dir: &Path, checker: F) -> Option { } fn env_tauri_app_path() -> Option { - std::env::var(ENV_TAURI_APP_PATH) - .map(PathBuf::from) - .ok()? - .canonicalize() - .ok() - .map(|p| dunce::simplified(&p).to_path_buf()) + let p = PathBuf::from(std::env::var_os(ENV_TAURI_APP_PATH)?); + dunce::canonicalize(p).ok() } fn env_tauri_frontend_path() -> Option { - std::env::var(ENV_TAURI_FRONTEND_PATH) - .map(PathBuf::from) - .ok()? - .canonicalize() - .ok() - .map(|p| dunce::simplified(&p).to_path_buf()) + let p = PathBuf::from(std::env::var_os(ENV_TAURI_FRONTEND_PATH)?); + dunce::canonicalize(p).ok() } pub fn resolve_tauri_dir() -> Option { diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index f21ce4a4b..d25c29d4f 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -12,9 +12,9 @@ pub use tauri_utils::{config::*, platform::Target}; use std::{ collections::HashMap, env::{current_dir, set_current_dir, set_var}, - ffi::OsStr, + ffi::{OsStr, OsString}, process::exit, - sync::{Arc, Mutex, OnceLock}, + sync::Mutex, }; use crate::error::Context; @@ -30,7 +30,7 @@ pub struct ConfigMetadata { inner: Config, /// The config extensions (platform-specific config files or the config CLI argument). /// Maps the extension name to its value. - extensions: HashMap, + extensions: HashMap, } impl std::ops::Deref for ConfigMetadata { @@ -50,7 +50,7 @@ impl ConfigMetadata { } /// Checks which config is overwriting the bundle identifier. - pub fn find_bundle_identifier_overwriter(&self) -> Option { + pub fn find_bundle_identifier_overwriter(&self) -> Option { for (ext, config) in &self.extensions { if let Some(identifier) = config .as_object() @@ -66,7 +66,7 @@ impl ConfigMetadata { } } -pub type ConfigHandle = Arc>>; +pub type ConfigHandle = &'static Mutex>; pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings { tauri_bundler::WixSettings { @@ -141,9 +141,9 @@ pub fn custom_sign_settings( } } -fn config_handle() -> &'static ConfigHandle { - static CONFIG_HANDLE: OnceLock = OnceLock::new(); - CONFIG_HANDLE.get_or_init(Default::default) +fn config_handle() -> ConfigHandle { + static CONFIG_HANDLE: Mutex> = Mutex::new(None); + &CONFIG_HANDLE } /// Gets the static parsed config from `tauri.conf.json`. @@ -153,14 +153,14 @@ fn get_internal( target: Target, ) -> crate::Result { if !reload && config_handle().lock().unwrap().is_some() { - return Ok(config_handle().clone()); + return Ok(config_handle()); } let tauri_dir = super::app_paths::tauri_dir(); let (mut config, config_path) = tauri_utils::config::parse::parse_value(target, tauri_dir.join("tauri.conf.json")) .context("failed to parse config")?; - let config_file_name = config_path.file_name().unwrap().to_string_lossy(); + let config_file_name = config_path.file_name().unwrap(); let mut extensions = HashMap::new(); let original_identifier = config @@ -174,10 +174,7 @@ fn get_internal( .context("failed to parse platform config")? { merge(&mut config, &platform_config); - extensions.insert( - config_path.file_name().unwrap().to_str().unwrap().into(), - platform_config, - ); + extensions.insert(config_path.file_name().unwrap().into(), platform_config); } if !merge_configs.is_empty() { @@ -203,9 +200,9 @@ fn get_internal( for error in errors { let path = error.instance_path.into_iter().join(" > "); if path.is_empty() { - log::error!("`{}` error: {}", config_file_name, error); + log::error!("`{config_file_name:?}` error: {}", error); } else { - log::error!("`{}` error on `{}`: {}", config_file_name, path, error); + log::error!("`{config_file_name:?}` error on `{}`: {}", path, error); } } if !reload { @@ -243,7 +240,7 @@ fn get_internal( extensions, }); - Ok(config_handle().clone()) + Ok(config_handle()) } pub fn get(target: Target, merge_configs: &[&serde_json::Value]) -> crate::Result { @@ -268,7 +265,7 @@ pub fn merge_with(merge_configs: &[&serde_json::Value]) -> crate::Result crate::Result Result) -> bool { let path = path.into(); - let source_file_name = path.file_name().unwrap().to_str().unwrap(); + let source_file_name = path.file_name().unwrap(); let lookup_platform_config = ENABLED_FORMATS .iter() .any(|format| source_file_name == format.into_platform_file_name(target)); diff --git a/crates/tauri-utils/src/platform.rs b/crates/tauri-utils/src/platform.rs index 542cea53c..2ace45790 100644 --- a/crates/tauri-utils/src/platform.rs +++ b/crates/tauri-utils/src/platform.rs @@ -238,16 +238,12 @@ const CARGO_OUTPUT_DIRECTORIES: &[&str] = &["debug", "release", "custom-profile" #[cfg(test)] fn is_cargo_output_directory(path: &std::path::Path) -> bool { - let last_component = path - .components() - .next_back() - .unwrap() - .as_os_str() - .to_str() - .unwrap(); + let Some(last_component) = path.components().next_back() else { + return false; + }; CARGO_OUTPUT_DIRECTORIES .iter() - .any(|dirname| &last_component == dirname) + .any(|dirname| &last_component.as_os_str() == dirname) } /// Computes the resource directory of the current environment. diff --git a/crates/tauri-utils/src/resources.rs b/crates/tauri-utils/src/resources.rs index 58a07d265..dfba0746c 100644 --- a/crates/tauri-utils/src/resources.rs +++ b/crates/tauri-utils/src/resources.rs @@ -97,9 +97,7 @@ impl<'a> ResourcePaths<'a> { iter: ResourcePathsIter { pattern_iter: PatternIter::Slice(patterns.iter()), allow_walk, - current_path: None, current_pattern: None, - current_dest: None, walk_iter: None, glob_iter: None, }, @@ -112,9 +110,7 @@ impl<'a> ResourcePaths<'a> { iter: ResourcePathsIter { pattern_iter: PatternIter::Map(patterns.iter()), allow_walk, - current_path: None, current_pattern: None, - current_dest: None, walk_iter: None, glob_iter: None, }, @@ -136,13 +132,9 @@ pub struct ResourcePathsIter<'a> { /// whether the resource paths allows directories or not. allow_walk: bool, - current_path: Option, - /// The key of map when `pattern_iter` is a [`PatternIter::Map`], + /// The (key, value) of map when `pattern_iter` is a [`PatternIter::Map`], /// used for determining [`Resource::target`] - current_pattern: Option, - /// The value of the map when `pattern_iter` is a [`PatternIter::Map`], - /// used for determining [`Resource::target`] - current_dest: Option, + current_pattern: Option<(String, PathBuf)>, walk_iter: Option, glob_iter: Option, @@ -157,8 +149,7 @@ impl ResourcePathsIter<'_> { Err(err) => return Some(Err(err.into())), }; - self.current_path = Some(normalize(&entry)); - self.next_current_path() + self.next_current_path(normalize(&entry)) } fn next_walk_iter(&mut self) -> Option> { @@ -169,8 +160,7 @@ impl ResourcePathsIter<'_> { Err(err) => return Some(Err(err.into())), }; - self.current_path = Some(normalize(entry.path())); - self.next_current_path() + self.next_current_path(normalize(entry.path())) } fn resource_from_path(&mut self, path: &Path) -> crate::Result { @@ -180,12 +170,11 @@ impl ResourcePathsIter<'_> { Ok(Resource { path: path.to_path_buf(), - target: if let Some(current_dest) = &self.current_dest { + target: if let Some((pattern, dest)) = &self.current_pattern { // if processing a directory, preserve directory structure under current_dest if self.walk_iter.is_some() { - let current_pattern = self.current_pattern.as_ref().unwrap(); - current_dest.join(path.strip_prefix(current_pattern).unwrap_or(path)) - } else if current_dest.components().count() == 0 { + dest.join(path.strip_prefix(pattern).unwrap_or(path)) + } else if dest.components().count() == 0 { // if current_dest is empty while processing a file pattern or glob // we preserve the file name as it is PathBuf::from(path.file_name().unwrap()) @@ -193,9 +182,9 @@ impl ResourcePathsIter<'_> { // if processing a glob and current_dest is not empty // we put all globbed paths under current_dest // preserving the file name as it is - current_dest.join(path.file_name().unwrap()) + dest.join(path.file_name().unwrap()) } else { - current_dest.clone() + dest.clone() } } else { // If `pattern_iter` is a [`PatternIter::Slice`] @@ -204,11 +193,7 @@ impl ResourcePathsIter<'_> { }) } - fn next_current_path(&mut self) -> Option> { - // should be safe to unwrap since every call to `self.next_current_path()` - // is preceded with assignment to `self.current_path` - let path = self.current_path.take().unwrap(); - + fn next_current_path(&mut self, path: PathBuf) -> Option> { let is_dir = path.is_dir(); if is_dir { @@ -238,15 +223,12 @@ impl ResourcePathsIter<'_> { fn next_pattern(&mut self) -> Option> { self.current_pattern = None; - self.current_dest = None; - self.current_path = None; let pattern = match &mut self.pattern_iter { PatternIter::Slice(iter) => iter.next()?, PatternIter::Map(iter) => { let (pattern, dest) = iter.next()?; - self.current_pattern = Some(pattern.clone()); - self.current_dest = Some(resource_relpath(Path::new(dest))); + self.current_pattern = Some((pattern.clone(), resource_relpath(Path::new(dest)))); pattern } }; @@ -265,8 +247,7 @@ impl ResourcePathsIter<'_> { } } - self.current_path = Some(normalize(Path::new(pattern))); - self.next_current_path() + self.next_current_path(normalize(Path::new(pattern))) } } @@ -282,10 +263,6 @@ impl Iterator for ResourcePathsIter<'_> { type Item = crate::Result; fn next(&mut self) -> Option> { - if self.current_path.is_some() { - return self.next_current_path(); - } - if self.walk_iter.is_some() { match self.next_walk_iter() { Some(r) => return Some(r), From ff5d76ca214b94a7b6e88aa4f0f797bbf747824d Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 14 Dec 2025 16:21:44 +0800 Subject: [PATCH 6/9] fix: default `WindowConfig::focus` to false in `Default::default` (#14653) --- .changes/window-config-focus-default-true.md | 5 +++++ crates/tauri-cli/config.schema.json | 2 +- .../schemas/config.schema.json | 2 +- crates/tauri-utils/src/config.rs | 12 ++++++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .changes/window-config-focus-default-true.md diff --git a/.changes/window-config-focus-default-true.md b/.changes/window-config-focus-default-true.md new file mode 100644 index 000000000..38d24aebc --- /dev/null +++ b/.changes/window-config-focus-default-true.md @@ -0,0 +1,5 @@ +--- +tauri: patch:bug +--- + +`WindowConfig::focus` is set to `false` in `WindowConfig::default()` diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 4ccf34d1b..148379e83 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -231,7 +231,7 @@ "type": "string" }, "create": { - "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": true, "type": "boolean" }, diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 4ccf34d1b..148379e83 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -231,7 +231,7 @@ "type": "string" }, "create": { - "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": true, "type": "boolean" }, diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index c90dc3e59..24b111830 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1653,7 +1653,7 @@ pub struct WindowConfig { /// ```rust /// tauri::Builder::default() /// .setup(|app| { - /// tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?; + /// tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?; /// Ok(()) /// }); /// ``` @@ -2006,7 +2006,7 @@ impl Default for WindowConfig { closable: true, title: default_title(), fullscreen: false, - focus: false, + focus: true, focusable: true, transparent: false, maximized: false, @@ -4384,4 +4384,12 @@ mod test { assert!(object_json.contains("\"cwd\":null") || !object_json.contains("cwd")); assert!(object_json.contains("\"args\":null") || !object_json.contains("args")); } + + #[test] + fn window_config_default_same_as_deserialize() { + let config_from_deserialization: WindowConfig = serde_json::from_str("{}").unwrap(); + let config_from_default: WindowConfig = WindowConfig::default(); + + assert_eq!(config_from_deserialization, config_from_default); + } } From 8254e5af6df4f780bf5bd879ada4ab69599b6545 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 18 Dec 2025 09:39:34 -0300 Subject: [PATCH 7/9] feat(bundler): support Liquid Glass icons, closes #14207 the `icon` config now supports loading an Assets.car directly or a `.icon` (Icon Composer asset) that gets compiled into an Assets.car file --- .changes/liquid-glass-icon.md | 5 + crates/tauri-bundler/src/bundle/macos/app.rs | 51 ++++--- crates/tauri-bundler/src/bundle/macos/icon.rs | 127 +++++++++++++++++- crates/tauri-bundler/src/bundle/macos/ios.rs | 2 +- crates/tauri-bundler/src/bundle/settings.rs | 13 +- 5 files changed, 179 insertions(+), 19 deletions(-) create mode 100644 .changes/liquid-glass-icon.md diff --git a/.changes/liquid-glass-icon.md b/.changes/liquid-glass-icon.md new file mode 100644 index 000000000..ab00b0fb3 --- /dev/null +++ b/.changes/liquid-glass-icon.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": minor:feat +--- + +Added support to Liquid Glass icons. diff --git a/crates/tauri-bundler/src/bundle/macos/app.rs b/crates/tauri-bundler/src/bundle/macos/app.rs index 703973c2b..8a5e2e40c 100644 --- a/crates/tauri-bundler/src/bundle/macos/app.rs +++ b/crates/tauri-bundler/src/bundle/macos/app.rs @@ -23,7 +23,7 @@ // files into the `Contents` directory of the bundle. use super::{ - icon::create_icns_file, + icon::{app_icon_name_from_assets_car, create_assets_car_file, create_icns_file}, sign::{notarize, notarize_auth, notarize_without_stapling, sign, SignTarget}, }; use crate::{ @@ -76,11 +76,19 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { let bin_dir = bundle_directory.join("MacOS"); let mut sign_paths = Vec::new(); - let bundle_icon_file: Option = - { create_icns_file(&resources_dir, settings).with_context(|| "Failed to create app icon")? }; + let bundle_icon_file = + create_icns_file(&resources_dir, settings).with_context(|| "Failed to create app icon")?; - create_info_plist(&bundle_directory, bundle_icon_file, settings) - .with_context(|| "Failed to create Info.plist")?; + let assets_car_file = create_assets_car_file(&resources_dir, settings) + .with_context(|| "Failed to create app Assets.car")?; + + create_info_plist( + &bundle_directory, + bundle_icon_file, + assets_car_file, + settings, + ) + .with_context(|| "Failed to create Info.plist")?; let framework_paths = copy_frameworks_to_bundle(&bundle_directory, settings) .with_context(|| "Failed to bundle frameworks")?; @@ -204,6 +212,7 @@ fn copy_custom_files_to_bundle(bundle_directory: &Path, settings: &Settings) -> fn create_info_plist( bundle_dir: &Path, bundle_icon_file: Option, + assets_car_file: Option, settings: &Settings, ) -> crate::Result<()> { let mut plist = plist::Dictionary::new(); @@ -213,17 +222,6 @@ fn create_info_plist( "CFBundleExecutable".into(), settings.main_binary_name()?.into(), ); - if let Some(path) = bundle_icon_file { - plist.insert( - "CFBundleIconFile".into(), - path - .file_name() - .expect("No file name") - .to_string_lossy() - .into_owned() - .into(), - ); - } plist.insert( "CFBundleIdentifier".into(), settings.bundle_identifier().into(), @@ -362,6 +360,27 @@ fn create_info_plist( ); } + if let Some(path) = bundle_icon_file { + plist.insert( + "CFBundleIconFile".into(), + path + .file_name() + .expect("No file name") + .to_string_lossy() + .into_owned() + .into(), + ); + } + + if let Some(assets_car_file) = assets_car_file { + if let Some(icon_name) = app_icon_name_from_assets_car(&assets_car_file) { + plist.insert("CFBundleIconName".into(), icon_name.clone().into()); + plist.insert("CFBundleIconFile".into(), icon_name.into()); + } else { + log::warn!("Failed to get icon name from Assets.car file"); + } + } + if let Some(protocols) = settings.deep_link_protocols() { plist.insert( "CFBundleURLTypes".into(), diff --git a/crates/tauri-bundler/src/bundle/macos/icon.rs b/crates/tauri-bundler/src/bundle/macos/icon.rs index c226fb233..fa2390600 100644 --- a/crates/tauri-bundler/src/bundle/macos/icon.rs +++ b/crates/tauri-bundler/src/bundle/macos/icon.rs @@ -4,13 +4,14 @@ // SPDX-License-Identifier: MIT use crate::bundle::Settings; -use crate::utils::{self, fs_utils}; +use crate::utils::{self, fs_utils, CommandExt}; use std::{ cmp::min, ffi::OsStr, fs::{self, File}, io::{self, BufWriter}, path::{Path, PathBuf}, + process::Command, }; use image::GenericImageView; @@ -63,6 +64,11 @@ pub fn create_icns_file(out_dir: &Path, settings: &Settings) -> crate::Result = vec![]; for icon_path in settings.icon_files() { let icon_path = icon_path?; + + if icon_path.extension().map_or(false, |ext| ext == "car") { + continue; + } + let icon = image::open(&icon_path)?; let density = if utils::is_retina(&icon_path) { 2 } else { 1 }; let (w, h) = icon.dimensions(); @@ -113,3 +119,122 @@ fn make_icns_image(img: image::DynamicImage) -> io::Result { }; icns::Image::from_data(pixel_format, img.width(), img.height(), img.into_bytes()) } + +/// Creates an Assets.car file from a .icon file if there are any in the settings. +/// Uses an existing Assets.car file if it exists in the settings. +/// Returns the path to the Assets.car file. +pub fn create_assets_car_file( + out_dir: &Path, + settings: &Settings, +) -> crate::Result> { + let Some(icons) = settings.bundle_settings().icon.as_ref() else { + return Ok(None); + }; + // If one of the icon files is already a CAR file, just use that. + let mut icon_composer_icon_path = None; + for icon in icons { + let icon_path = Path::new(&icon).to_path_buf(); + if icon_path.extension() == Some(OsStr::new("car")) { + let dest_path = out_dir.join("Assets.car"); + fs_utils::copy_file(&icon_path, &dest_path)?; + return Ok(Some(dest_path)); + } + + if icon_path.extension() == Some(OsStr::new("icon")) { + icon_composer_icon_path.replace(icon_path); + } + } + + let Some(icon_composer_icon_path) = icon_composer_icon_path else { + return Ok(None); + }; + + // Create a temporary directory for actool work + let temp_dir = tempfile::tempdir() + .map_err(|e| crate::Error::GenericError(format!("failed to create temp dir: {e}")))?; + + let icon_dest_path = temp_dir.path().join("Icon.icon"); + let output_path = temp_dir.path().join("out"); + + // Copy the input .icon directory to the temp directory + if icon_composer_icon_path.is_dir() { + fs_utils::copy_dir(&icon_composer_icon_path, &icon_dest_path)?; + } else { + return Err(crate::Error::GenericError(format!( + "{} must be a directory", + icon_composer_icon_path.display() + ))); + } + + // Create the output directory + fs::create_dir_all(&output_path)?; + + // Run actool command + let mut cmd = Command::new("actool"); + cmd.arg(&icon_dest_path); + cmd.arg("--compile"); + cmd.arg(&output_path); + cmd.arg("--output-format"); + cmd.arg("human-readable-text"); + cmd.arg("--notices"); + cmd.arg("--warnings"); + cmd.arg("--output-partial-info-plist"); + cmd.arg(output_path.join("assetcatalog_generated_info.plist")); + cmd.arg("--app-icon"); + cmd.arg("Icon"); + cmd.arg("--include-all-app-icons"); + cmd.arg("--accent-color"); + cmd.arg("AccentColor"); + cmd.arg("--enable-on-demand-resources"); + cmd.arg("NO"); + cmd.arg("--development-region"); + cmd.arg("en"); + cmd.arg("--target-device"); + cmd.arg("mac"); + cmd.arg("--minimum-deployment-target"); + cmd.arg("26.0"); + cmd.arg("--platform"); + cmd.arg("macosx"); + + cmd.output_ok()?; + + let assets_car_path = output_path.join("Assets.car"); + if !assets_car_path.exists() { + return Err(crate::Error::GenericError( + "actool did not generate Assets.car file".to_owned(), + )); + } + + // copy to out_dir + fs_utils::copy_file(&assets_car_path, &out_dir.join("Assets.car"))?; + + Ok(Some(out_dir.join("Assets.car"))) +} + +#[derive(serde::Deserialize)] +struct AssetsCarInfo { + #[serde(rename = "AssetType", default)] + asset_type: String, + #[serde(rename = "Name", default)] + name: String, +} + +pub fn app_icon_name_from_assets_car(assets_car_path: &Path) -> Option { + let Ok(output) = Command::new("assetutil") + .arg("--info") + .arg(assets_car_path) + .output_ok() + .inspect_err(|e| log::error!("Failed to get app icon name from Assets.car file: {e}")) + else { + return None; + }; + + let output = String::from_utf8(output.stdout).ok()?; + let assets_car_info: Vec = serde_json::from_str(&output) + .inspect_err(|e| log::error!("Failed to parse Assets.car file info: {e}")) + .ok()?; + assets_car_info + .iter() + .find(|info| info.asset_type == "Icon Image") + .map(|info| info.name.clone()) +} diff --git a/crates/tauri-bundler/src/bundle/macos/ios.rs b/crates/tauri-bundler/src/bundle/macos/ios.rs index ac035127a..e7cada1c3 100644 --- a/crates/tauri-bundler/src/bundle/macos/ios.rs +++ b/crates/tauri-bundler/src/bundle/macos/ios.rs @@ -106,7 +106,7 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result< // Fall back to non-PNG files for any missing sizes. for icon_path in settings.icon_files() { let icon_path = icon_path?; - if icon_path.extension() == Some(OsStr::new("png")) { + if icon_path.extension().map_or(false, |ext| ext == "png" || ext == "car") { continue; } else if icon_path.extension() == Some(OsStr::new("icns")) { let icon_family = icns::IconFamily::read(File::open(&icon_path)?)?; diff --git a/crates/tauri-bundler/src/bundle/settings.rs b/crates/tauri-bundler/src/bundle/settings.rs index 62f7813d2..78cc27a83 100644 --- a/crates/tauri-bundler/src/bundle/settings.rs +++ b/crates/tauri-bundler/src/bundle/settings.rs @@ -795,6 +795,8 @@ pub struct Settings { local_tools_directory: Option, /// the bundle settings. bundle_settings: BundleSettings, + /// Same as `bundle_settings.icon`, but without the .icon directory. + icon_files: Option>, /// the binaries to bundle. binaries: Vec, /// The target platform. @@ -906,6 +908,14 @@ impl SettingsBuilder { }; let target_platform = TargetPlatform::from_triple(&target); + let icon_files = self.bundle_settings.icon.as_ref().map(|paths| { + paths + .iter() + .filter(|p| !p.ends_with(".icon")) + .cloned() + .collect() + }); + Ok(Settings { log_level: self.log_level.unwrap_or(log::Level::Error), package: self @@ -925,6 +935,7 @@ impl SettingsBuilder { .map(|bins| external_binaries(bins, &target, &target_platform)), ..self.bundle_settings }, + icon_files, target_platform, target, no_sign: self.no_sign, @@ -1092,7 +1103,7 @@ impl Settings { /// Returns an iterator over the icon files to be used for this bundle. pub fn icon_files(&self) -> ResourcePaths<'_> { - match self.bundle_settings.icon { + match self.icon_files { Some(ref paths) => ResourcePaths::new(paths.as_slice(), false), None => ResourcePaths::new(&[], false), } From e4621497baa5752d4fb57a50ed8eab484218832c Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 18 Dec 2025 09:41:30 -0300 Subject: [PATCH 8/9] fmt --- crates/tauri-bundler/src/bundle/macos/ios.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/tauri-bundler/src/bundle/macos/ios.rs b/crates/tauri-bundler/src/bundle/macos/ios.rs index e7cada1c3..644f85027 100644 --- a/crates/tauri-bundler/src/bundle/macos/ios.rs +++ b/crates/tauri-bundler/src/bundle/macos/ios.rs @@ -106,7 +106,10 @@ fn generate_icon_files(bundle_dir: &Path, settings: &Settings) -> crate::Result< // Fall back to non-PNG files for any missing sizes. for icon_path in settings.icon_files() { let icon_path = icon_path?; - if icon_path.extension().map_or(false, |ext| ext == "png" || ext == "car") { + if icon_path + .extension() + .map_or(false, |ext| ext == "png" || ext == "car") + { continue; } else if icon_path.extension() == Some(OsStr::new("icns")) { let icon_family = icns::IconFamily::read(File::open(&icon_path)?)?; From d5751e6ebf1cd6e7080e96bcfa79dc6ff14f5e1e Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 18 Dec 2025 09:43:47 -0300 Subject: [PATCH 9/9] fix build --- crates/tauri-bundler/src/bundle/macos/icon.rs | 2 +- crates/tauri-bundler/src/bundle/settings.rs | 5 +++++ crates/tauri-cli/src/mobile/ios/dev.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/macos/icon.rs b/crates/tauri-bundler/src/bundle/macos/icon.rs index fa2390600..8adf5eaf0 100644 --- a/crates/tauri-bundler/src/bundle/macos/icon.rs +++ b/crates/tauri-bundler/src/bundle/macos/icon.rs @@ -127,7 +127,7 @@ pub fn create_assets_car_file( out_dir: &Path, settings: &Settings, ) -> crate::Result> { - let Some(icons) = settings.bundle_settings().icon.as_ref() else { + let Some(icons) = settings.icons() else { return Ok(None); }; // If one of the icon files is already a CAR file, just use that. diff --git a/crates/tauri-bundler/src/bundle/settings.rs b/crates/tauri-bundler/src/bundle/settings.rs index 78cc27a83..1e37dc07c 100644 --- a/crates/tauri-bundler/src/bundle/settings.rs +++ b/crates/tauri-bundler/src/bundle/settings.rs @@ -969,6 +969,11 @@ impl Settings { &self.target_platform } + /// Raw list of icons. + pub fn icons(&self) -> Option<&Vec> { + self.bundle_settings.icon.as_ref() + } + /// Returns the architecture for the binary being bundled (e.g. "arm", "x86" or "x86_64"). pub fn binary_arch(&self) -> Arch { if self.target.starts_with("x86_64") { diff --git a/crates/tauri-cli/src/mobile/ios/dev.rs b/crates/tauri-cli/src/mobile/ios/dev.rs index 45cd44f5b..2dd44b77a 100644 --- a/crates/tauri-cli/src/mobile/ios/dev.rs +++ b/crates/tauri-cli/src/mobile/ios/dev.rs @@ -312,7 +312,7 @@ fn run_dev( use_network_address_for_dev_url(&tauri_config, &mut dev_options, options.force_ip_prompt)?; } - crate::dev::setup(&interface, &mut dev_options, tauri_config.clone())?; + crate::dev::setup(&interface, &mut dev_options, tauri_config)?; let app_settings = interface.app_settings(); let out_dir = app_settings.out_dir(&InterfaceOptions {