From e708f9051758c90f95e707d207c745ba24a0b1be Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 4 Jun 2026 02:34:56 +0300 Subject: [PATCH] fix(macos): statically link liblzma so the app launches (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vtkio (via truck-meshalgo → xz2 → lzma-sys) linked the system liblzma dynamically, baking a Homebrew path (/opt/homebrew/.../liblzma.5.dylib) into the macOS binary. The .app then crashed on launch on any Mac without that exact library. Enable lzma-sys's `static` feature so liblzma is compiled from the bundled source into the binary, making it self-contained on every platform (verified: no dynamic liblzma link). Co-Authored-By: Claude Opus 4.8 --- Cargo.lock | 1 + Cargo.toml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 36655aa41..d5d3c61be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,7 @@ dependencies = [ "iced", "image", "inventory", + "lzma-sys", "open", "printpdf", "rayon", diff --git a/Cargo.toml b/Cargo.toml index 076c79c76..ba1e032aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,13 @@ edition = "2021" build = "build.rs" [dependencies] +# vtkio (pulled in transitively via truck-meshalgo) depends on xz2 → lzma-sys, +# which by default links the system liblzma dynamically. On macOS that bakes a +# Homebrew dylib path (/opt/homebrew/.../liblzma.5.dylib) into the binary, so +# the .app crashes on launch on machines without that exact library (#56). +# Forcing the `static` feature builds liblzma from the bundled source, making +# the binary self-contained on every platform. +lzma-sys = { version = "0.1", features = ["static"] } iced = { version = "0.14", features = ["debug", "image", "svg", "advanced", "canvas", "smol"] } bytemuck = { version = "1.25", features = ["derive"] } glam = { version = "0.33", features = ["bytemuck"] }