Switch fully to Rust Livekit (redux) (#27126)

Swift bindings BEGONE

Release Notes:

- Switched from using the Swift LiveKit bindings, to the Rust bindings,
fixing https://github.com/zed-industries/zed/issues/9396, a crash when
leaving a collaboration session, and making Zed easier to build.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Michael Sloan <michael@zed.dev>
This commit is contained in:
Mikayla Maki 2025-03-28 10:58:23 -07:00 committed by GitHub
parent c8fb95cd1b
commit 8a307e7b89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 2393 additions and 7579 deletions

View file

@ -221,13 +221,9 @@ function sign_app_binaries() {
local app_path=$1
local architecture=$2
local architecture_dir=$3
echo "Copying WebRTC.framework into the frameworks folder"
rm -rf "${app_path}/Contents/Frameworks"
mkdir -p "${app_path}/Contents/Frameworks"
if [ "$local_arch" = false ]; then
cp -R target/${local_target_triple}/${target_dir}/WebRTC.framework "${app_path}/Contents/Frameworks/"
else
cp -R target/${target_dir}/WebRTC.framework "${app_path}/Contents/Frameworks/"
if [ "$local_arch" = true ]; then
cp -R target/${target_dir}/cli "${app_path}/Contents/MacOS/"
fi
@ -240,7 +236,6 @@ function sign_app_binaries() {
if [[ $can_code_sign = true ]]; then
echo "Code signing binaries"
# sequence of codesign commands modeled after this example: https://developer.apple.com/forums/thread/701514
/usr/bin/codesign --deep --force --timestamp --sign "$IDENTITY" "${app_path}/Contents/Frameworks/WebRTC.framework" -v
/usr/bin/codesign --deep --force --timestamp --options runtime --sign "$IDENTITY" "${app_path}/Contents/MacOS/cli" -v
/usr/bin/codesign --deep --force --timestamp --options runtime --sign "$IDENTITY" "${app_path}/Contents/MacOS/git" -v
/usr/bin/codesign --deep --force --timestamp --options runtime --entitlements crates/zed/resources/zed.entitlements --sign "$IDENTITY" "${app_path}/Contents/MacOS/zed" -v

View file

@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -exuo pipefail
git apply script/patches/use-cross-platform-livekit.patch
# Re-enable error skipping for this check, so that we can unapply the patch
set +e
cargo check -p workspace
exit_code=$?
# Disable error skipping again
set -e
git apply -R script/patches/use-cross-platform-livekit.patch
exit "$exit_code"

View file

@ -1,59 +0,0 @@
diff --git a/crates/call/Cargo.toml b/crates/call/Cargo.toml
index 9ba10e56ba..bb69440691 100644
--- a/crates/call/Cargo.toml
+++ b/crates/call/Cargo.toml
@@ -41,10 +41,10 @@ serde_derive.workspace = true
telemetry.workspace = true
util.workspace = true
-[target.'cfg(target_os = "macos")'.dependencies]
+[target.'cfg(any())'.dependencies]
livekit_client_macos.workspace = true
-[target.'cfg(not(target_os = "macos"))'.dependencies]
+[target.'cfg(all())'.dependencies]
livekit_client.workspace = true
[dev-dependencies]
diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs
index 5e212d35b7..a8f9e8f43e 100644
--- a/crates/call/src/call.rs
+++ b/crates/call/src/call.rs
@@ -1,13 +1,13 @@
pub mod call_settings;
-#[cfg(target_os = "macos")]
+#[cfg(any())]
mod macos;
-#[cfg(target_os = "macos")]
+#[cfg(any())]
pub use macos::*;
-#[cfg(not(target_os = "macos"))]
+#[cfg(all())]
mod cross_platform;
-#[cfg(not(target_os = "macos"))]
+#[cfg(all())]
pub use cross_platform::*;
diff --git a/crates/workspace/src/shared_screen.rs b/crates/workspace/src/shared_screen.rs
index 1d17cfa145..f845234987 100644
--- a/crates/workspace/src/shared_screen.rs
+++ b/crates/workspace/src/shared_screen.rs
@@ -1,11 +1,11 @@
-#[cfg(target_os = "macos")]
+#[cfg(any())]
mod macos;
-#[cfg(target_os = "macos")]
+#[cfg(any())]
pub use macos::*;
-#[cfg(not(target_os = "macos"))]
+#[cfg(all())]
mod cross_platform;
-#[cfg(not(target_os = "macos"))]
+#[cfg(all())]
pub use cross_platform::*;