From 4069411349028c8ebecbc3e7b80a680be8fbd290 Mon Sep 17 00:00:00 2001 From: jt Date: Fri, 24 Jul 2026 22:39:35 -0700 Subject: [PATCH] Vendor OpenSSL on macOS to fix the x86_64 cross-compile GitHub macos-latest runners are ARM, so the x86_64-apple-darwin release build is a cross-compile and openssl-sys (via curl-sys) fails: pkg-config refuses to provide the host ARM OpenSSL for a foreign target. Build OpenSSL from source on macOS instead, scoped so the Linux build keeps linking the system library as before. Co-Authored-By: Claude Fable 5 --- src-tauri/Cargo.lock | 11 +++++++++++ src-tauri/Cargo.toml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index f7d11a2..d6fb1b9 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2228,6 +2228,7 @@ dependencies = [ "base64 0.21.7", "curl", "futures-util", + "openssl-sys", "rand 0.8.5", "reqwest 0.11.27", "serde", @@ -2763,6 +2764,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.6.1+3.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.104" @@ -2771,6 +2781,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4da4fa1..6a84387 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -36,3 +36,9 @@ rand = "0.8" [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-updater = "2" + +# macOS release builds cross-compile x86_64 on ARM runners, where pkg-config +# can't provide OpenSSL for the foreign target — build it from source instead. +# Scoped to macOS so Linux keeps linking the system OpenSSL. +[target.'cfg(target_os = "macos")'.dependencies] +openssl-sys = { version = "0.9", features = ["vendored"] }