From 6bdb08ab9c0d95c14c93cec595503d1ee9c846cb Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 20 Oct 2022 13:18:53 -0600 Subject: [PATCH] Fix crash loading Swift symbol (I think associated with concurrency) I add /usr/lib/swift as an rpath, which seems to fix the issue even though there doesn't seem to be a relevant library at that location on my machine. Based on my research, wondering if `-Wl,-weak-lswiftCompatibilityConcurrency` is also required for this to work on older OSes, but holding back for now. --- crates/live_kit_client/build.rs | 1 - crates/zed/build.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/live_kit_client/build.rs b/crates/live_kit_client/build.rs index 6c5704b9db..4bbd61ac10 100644 --- a/crates/live_kit_client/build.rs +++ b/crates/live_kit_client/build.rs @@ -81,7 +81,6 @@ fn build_bridge(swift_target: &SwiftTarget) { } fn link_swift_stdlib(swift_target: &SwiftTarget) { - panic!("{:?}", swift_target.paths.runtime_library_paths); for path in &swift_target.paths.runtime_library_paths { println!("cargo:rustc-link-search=native={}", path); } diff --git a/crates/zed/build.rs b/crates/zed/build.rs index c140f333f4..3d75886f1c 100644 --- a/crates/zed/build.rs +++ b/crates/zed/build.rs @@ -15,6 +15,9 @@ fn main() { println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path"); } + // Seems to be required to enable Swift concurrency + println!("cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/swift"); + // Register exported Objective-C selectors, protocols, etc println!("cargo:rustc-link-arg=-Wl,-ObjC");