From 8c29e7a7e3cd27928e9bad7c39008c33bd9d6a54 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Wed, 17 Jun 2026 21:20:06 -0500 Subject: [PATCH] fix(build): remove SODIUM_USE_PKG_CONFIG from .cargo/config.toml [env] block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cargo injects [env] entries directly into build script environments, bypassing shell-level unset and env -u entirely. SODIUM_USE_PKG_CONFIG was set to "0" in [env], which libsodium-sys-stable build.rs treats as "pkg-config enabled" (env::var().is_ok() returns true for any value including "0"). Combined with SODIUM_LIB_DIR set in the workflow, this triggered the incompatibility panic on every build. The original comment claiming this "avoids memset_explicit on Windows" was incorrect — SODIUM_USE_PKG_CONFIG controls detection strategy, not link behaviour. The actual Windows memset_explicit fix is handled via SODIUM_LIB_DIR pointing to pre-built MinGW sodium. --- src-tauri/.cargo/config.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/src-tauri/.cargo/config.toml b/src-tauri/.cargo/config.toml index 37432416..2efdbb41 100644 --- a/src-tauri/.cargo/config.toml +++ b/src-tauri/.cargo/config.toml @@ -9,7 +9,4 @@ rustflags = ["-C", "link-arg=-Wl,--exclude-all-symbols"] # Use system OpenSSL instead of vendoring from source (which requires Perl modules # unavailable on some environments and breaks clippy/check). OPENSSL_NO_VENDOR = "1" - -# Force libsodium to use minimal mode which avoids memset_explicit on Windows -SODIUM_USE_PKG_CONFIG = "0" SODIUM_STATIC = "1" -- 2.45.2