From baf4fc3b5942feccf0329fe46e2d53be884485d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Vasconcellos?= Date: Fri, 20 Oct 2023 05:22:36 -0300 Subject: [PATCH] [ENG-1325] Vendor openssl in tauri (#1636) * Vendor openssl dependency * Remove bindgen, seems like windows don't like it - Add OPENSSL_RUST_USE_NASM to force windows to use nasm * Add native-tls-vendored to reqwest - Shouldn't change much as the openssl crates override was already dealing with the vendoring anyway --- .cargo/config.toml.mustache | 7 +++++-- Cargo.lock | Bin 236302 -> 236302 bytes Cargo.toml | 2 +- apps/desktop/src-tauri/Cargo.toml | 1 + apps/mobile/modules/sd-core/core/Cargo.toml | 6 ------ core/Cargo.toml | 16 ++++++++++++++-- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.cargo/config.toml.mustache b/.cargo/config.toml.mustache index 42bb1b1b8..46c877cdc 100644 --- a/.cargo/config.toml.mustache +++ b/.cargo/config.toml.mustache @@ -1,10 +1,13 @@ [env] {{#protoc}} -PROTOC = "{{{protoc}}}" +PROTOC = { force = true, value = "{{{protoc}}}" } {{/protoc}} {{^isLinux}} -FFMPEG_DIR = "{{{nativeDeps}}}" +FFMPEG_DIR = { force = true, value = "{{{nativeDeps}}}" } {{/isLinux}} +OPENSSL_STATIC = { force = true, value = "1" } +OPENSSL_NO_VENDOR = { force = true, value = "0" } +OPENSSL_RUST_USE_NASM = { force = true, value = "1" } {{#isMacOS}} [target.x86_64-apple-darwin] diff --git a/Cargo.lock b/Cargo.lock index 900e7b38abc26aff0cb9b43c05d777aba538058e..8dabbf28d25123d0b59acd3f28629d47724d9808 100644 GIT binary patch delta 43 zcmeC%#@Dxvuc3u;3zJmg^o=!4GLy@cM7Qe~GBt5eZ!KgJXun&-wEb=kv!NUSW>pW? delta 49 zcmeC%#@Dxvuc3u;3zJmgcC$jJ>D<$$3Ylc4FRy13o$l_;C@?*|l1Z|iyOwD?cP%rs F8~~_T4=Dfu diff --git a/Cargo.toml b/Cargo.toml index 70c624e8f..cddf716c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ tracing-subscriber = { git = "https://github.com/tokio-rs/tracing", rev = "29146 tracing-appender = { git = "https://github.com/tokio-rs/tracing", rev = "29146260fb4615d271d2e899ad95a753bb42915e" } # Unreleased changes for rolling log deletion rspc = { version = "0.1.4" } -specta = { version = "1.0.4" } +specta = { version = "1.0.5" } tauri-specta = { version = "1.0.2" } swift-rs = { version = "1.0.6" } diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index aa297a7f8..6ebe2621e 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -19,6 +19,7 @@ tauri = { version = "1.5.2", features = [ "shell-all", "updater", "window-all", + "native-tls-vendored" ] } rspc = { workspace = true, features = ["tauri"] } diff --git a/apps/mobile/modules/sd-core/core/Cargo.toml b/apps/mobile/modules/sd-core/core/Cargo.toml index f21f6c8e7..6e489054e 100644 --- a/apps/mobile/modules/sd-core/core/Cargo.toml +++ b/apps/mobile/modules/sd-core/core/Cargo.toml @@ -14,12 +14,6 @@ sd-core = { path = "../../../../../core", features = [ rspc = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } -openssl = { version = "0.10.57", features = [ - "vendored", -] } # Override features of transitive dependencies -openssl-sys = { version = "0.9.93", features = [ - "vendored", -] } # Override features of transitive dependencies to support IOS Simulator on M1 futures = "0.3.28" tracing = { workspace = true } futures-channel = "0.3.28" diff --git a/core/Cargo.toml b/core/Cargo.toml index 4c470eaa2..710ed763f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -28,7 +28,11 @@ sd-crypto = { path = "../crates/crypto", features = [ "keymanager", ] } -sd-images = { path = "../crates/images", features = ["rspc", "serde", "specta"] } +sd-images = { path = "../crates/images", features = [ + "rspc", + "serde", + "specta", +] } sd-file-ext = { path = "../crates/file-ext" } sd-sync = { path = "../crates/sync" } sd-p2p = { path = "../crates/p2p", features = ["specta", "serde"] } @@ -105,9 +109,17 @@ axum = "0.6.20" http-body = "0.4.5" pin-project-lite = "0.2.13" bytes = "1.5.0" -reqwest = { version = "0.11.20", features = ["json"] } +reqwest = { version = "0.11.20", features = ["json", "native-tls-vendored"] } directories = "5.0.1" +# Override features of transitive dependencies +[dependencies.openssl] +version = "=0.10.57" +features = ["vendored"] +[dependencies.openssl-sys] +version = "=0.9.93" +features = ["vendored"] + [target.'cfg(target_os = "macos")'.dependencies] plist = "1"