From d710946064c47fa488eca01a62403e70b2b5ff87 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Thu, 24 Nov 2022 09:38:19 -0300 Subject: [PATCH] refactor: move Linux custom protocol headers support behind feature flag (#5683) --- .changes/linux-headers.md | 5 +++++ .github/workflows/lint-fmt-core.yml | 2 +- .github/workflows/test-core.yml | 2 +- core/tauri-runtime-wry/Cargo.toml | 3 ++- core/tauri/Cargo.toml | 1 + core/tauri/src/lib.rs | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changes/linux-headers.md diff --git a/.changes/linux-headers.md b/.changes/linux-headers.md new file mode 100644 index 000000000..cd2ffc685 --- /dev/null +++ b/.changes/linux-headers.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Moved the custom protocol headers support on Linux behind the `linux-protocol-headers` Cargo feature to enhance compatibility with older Linux distributions. diff --git a/.github/workflows/lint-fmt-core.yml b/.github/workflows/lint-fmt-core.yml index bda17f34b..04fe41f42 100644 --- a/.github/workflows/lint-fmt-core.yml +++ b/.github/workflows/lint-fmt-core.yml @@ -50,7 +50,7 @@ jobs: clippy: - { args: '', key: 'empty' } - { - args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart', + args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart', key: 'all' } - { args: '--features custom-protocol', key: 'custom-protocol' } diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 965008b04..9cc4bd607 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -56,7 +56,7 @@ jobs: key: api-all } - { - args: --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart, + args: --features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart, key: all } diff --git a/core/tauri-runtime-wry/Cargo.toml b/core/tauri-runtime-wry/Cargo.toml index 44bcf1e66..bb2ed3cea 100644 --- a/core/tauri-runtime-wry/Cargo.toml +++ b/core/tauri-runtime-wry/Cargo.toml @@ -13,7 +13,7 @@ exclude = [ "CHANGELOG.md", "/target" ] readme = "README.md" [dependencies] -wry = { version = "0.22", default-features = false, features = [ "file-drop", "protocol" ] } +wry = { version = "0.22.4", default-features = false, features = [ "file-drop", "protocol" ] } tauri-runtime = { version = "0.12.0", path = "../tauri-runtime" } tauri-utils = { version = "1.2.0", path = "../tauri-utils" } uuid = { version = "1", features = [ "v4" ] } @@ -47,3 +47,4 @@ macos-private-api = [ objc-exception = [ "wry/objc-exception" ] global-shortcut = [ "tauri-runtime/global-shortcut" ] clipboard = [ "tauri-runtime/clipboard" ] +linux-headers = ["wry/linux-headers"] diff --git a/core/tauri/Cargo.toml b/core/tauri/Cargo.toml index 85e9bb66b..a9a2e82c9 100644 --- a/core/tauri/Cargo.toml +++ b/core/tauri/Cargo.toml @@ -129,6 +129,7 @@ default = [ "wry", "compression", "objc-exception" ] compression = [ "tauri-macros/compression", "tauri-utils/compression" ] wry = [ "tauri-runtime-wry" ] objc-exception = [ "tauri-runtime-wry/objc-exception" ] +linux-protocol-headers = [ "tauri-runtime-wry/linux-headers" ] isolation = [ "tauri-utils/isolation", "tauri-macros/isolation" ] custom-protocol = [ "tauri-macros/custom-protocol" ] updater = [ diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index c0c344862..6ce3bdd8d 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -13,6 +13,7 @@ //! - **wry** *(enabled by default)*: Enables the [wry](https://github.com/tauri-apps/wry) runtime. Only disable it if you want a custom runtime. //! - **dox**: Internal feature to generate Rust documentation without linking on Linux. //! - **objc-exception**: Wrap each msg_send! in a @try/@catch and panics if an exception is caught, preventing Objective-C from unwinding into Rust. +//! - **linux-protocol-headers**: Enables headers support for custom protocol requests on Linux. Requires webkit2gtk v2.36 or above. //! - **isolation**: Enables the isolation pattern. Enabled by default if the `tauri > pattern > use` config option is set to `isolation` on the `tauri.conf.json` file. //! - **custom-protocol**: Feature managed by the Tauri CLI. When enabled, Tauri assumes a production environment instead of a development one. //! - **updater**: Enables the application auto updater. Enabled by default if the `updater` config is defined on the `tauri.conf.json` file.