From 2db50797d7f20a5077042bc21f6148b90015667a Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Thu, 16 Jul 2026 17:21:48 +0200 Subject: [PATCH 1/4] Changes to document local development better --- AGENTS.md | 5 +++++ Cargo.toml | 8 ++++++-- README.md | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2fca58d..65a2568 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,6 +6,11 @@ - It has been moved here to become a refined, standalone developer tool - Existing code may not adhere to the requirements defined herein, however, new code and refactors should +## Building + +- `cargo run` builds and runs the app against the pinned, published LiveKit crates +- To build against a local `rust-sdks` checkout, uncomment the `[patch.crates-io]` block in _Cargo.toml_ (see "Building against a local rust-sdks" in _README.md_) + ## UI best practices - This application uses [egui](https://docs.rs/egui/latest/egui/) diff --git a/Cargo.toml b/Cargo.toml index f92a17e..739a27e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,12 @@ winit = { version = "0.30.13", features = [ "android-native-activity" ] } livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } -# For local development, use a path override to the rust-sdks repo: -# livekit = { path = "../rust-sdks", features = ["rustls-tls-native-roots"] } +# To build against a local checkout of the LiveKit Rust SDK, clone +# https://github.com/livekit/rust-sdks to ../rust-sdks and uncomment +# (see "Building against a local rust-sdks" in README.md): +# [patch.crates-io] +# livekit = { path = "../rust-sdks/livekit" } +# livekit-api = { path = "../rust-sdks/livekit-api" } [package.metadata.bundle] name = "LiveKit Client" diff --git a/README.md b/README.md index 4d6858b..c2bc430 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,36 @@ An example of building a cross-platform, GUI application using the [LiveKit Rust - [x] Simulate fault scenarios (e.g., reconnect, migration, etc.) - [x] Send/receive remote procedure calls (RPC) - [x] Send/receive data streams + +## Building + +The app builds and runs against the pinned, published LiveKit crates by default: + +```sh +cargo run # debug +cargo run --release # optimized +``` + +The Rust toolchain is pinned in `rust-toolchain.toml` and selected automatically. The first build downloads a prebuilt `libwebrtc`, so it needs network access. + +### Building against a local rust-sdks + +To build against a local checkout of the [LiveKit Rust SDK](https://github.com/livekit/rust-sdks) instead of the published crates: + +1. Clone the SDK next to this repository: + ```sh + git clone https://github.com/livekit/rust-sdks ../rust-sdks + ``` +2. Uncomment the `[patch.crates-io]` block in `Cargo.toml` and comment in the upper appearance of `livekit` and `livekit-api` (edit the paths if your checkout lives elsewhere): + ```toml + [patch.crates-io] + livekit = { path = "../rust-sdks/livekit" } + livekit-api = { path = "../rust-sdks/livekit-api" } + ``` +3. If the checkout's crate version differs from `Cargo.lock`, bind it once so the patch takes effect — otherwise cargo prints `warning: patch ... was not used in the crate graph` and keeps the published version: + ```sh + cargo update -p livekit -p livekit-api + ``` +4. `cargo run` — and rust-analyzer — now build against the local sources. + +To return to the published crates, re-comment the block and run `git checkout Cargo.lock`. From 4cf793e277d432bf675302624f894e7a9c52bcda Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Thu, 16 Jul 2026 17:28:46 +0200 Subject: [PATCH 2/4] Use weird spelling thing --- cspell.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/cspell.yml b/cspell.yml index dc39d36..8839cf4 100644 --- a/cspell.yml +++ b/cspell.yml @@ -20,6 +20,7 @@ words: - fira - firacode - idents + - libwebrtc - livekit - msvc - noninteractive From 91031edc2b40334486c40b36caae724af0a8d72c Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Thu, 16 Jul 2026 17:49:55 +0200 Subject: [PATCH 3/4] It works --- Cargo.toml | 15 +++++++-------- README.md | 16 ++++++---------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 739a27e..c1e1305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,15 +18,14 @@ tokio = { version = "1", features = ["full", "parking_lot"] } # egui-wgpu 0.35 requires wgpu ^29.0; "29.0" resolves to a compatible 29.0.x. wgpu = "29.0" winit = { version = "0.30.13", features = [ "android-native-activity" ] } -livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } -livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } +# livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } +# livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } -# To build against a local checkout of the LiveKit Rust SDK, clone -# https://github.com/livekit/rust-sdks to ../rust-sdks and uncomment -# (see "Building against a local rust-sdks" in README.md): -# [patch.crates-io] -# livekit = { path = "../rust-sdks/livekit" } -# livekit-api = { path = "../rust-sdks/livekit-api" } +# For local SDK development, comment out the two lines above and uncomment these +# (clone https://github.com/livekit/rust-sdks to ../rust-sdks first; see +# "Building against a local rust-sdks" in README.md): +livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } +livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } [package.metadata.bundle] name = "LiveKit Client" diff --git a/README.md b/README.md index c2bc430..e6da3c6 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,12 @@ To build against a local checkout of the [LiveKit Rust SDK](https://github.com/l ```sh git clone https://github.com/livekit/rust-sdks ../rust-sdks ``` -2. Uncomment the `[patch.crates-io]` block in `Cargo.toml` and comment in the upper appearance of `livekit` and `livekit-api` (edit the paths if your checkout lives elsewhere): +2. In `Cargo.toml`, comment out the two published `livekit` / `livekit-api` lines and uncomment the `path` lines below them (edit the paths if your checkout lives elsewhere): ```toml - [patch.crates-io] - livekit = { path = "../rust-sdks/livekit" } - livekit-api = { path = "../rust-sdks/livekit-api" } + livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } + livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } ``` -3. If the checkout's crate version differs from `Cargo.lock`, bind it once so the patch takes effect — otherwise cargo prints `warning: patch ... was not used in the crate graph` and keeps the published version: - ```sh - cargo update -p livekit -p livekit-api - ``` -4. `cargo run` — and rust-analyzer — now build against the local sources. + These are plain `path` dependencies, so cargo re-resolves automatically — no `cargo update` needed. +3. `cargo run` — and rust-analyzer — now build against the local sources. -To return to the published crates, re-comment the block and run `git checkout Cargo.lock`. +To return to the published crates, reverse step 2: uncomment the two version lines and comment the `path` lines back out. From a9a0b1fd2cc060bb9e516e6394cfeb2d5b147ff3 Mon Sep 17 00:00:00 2001 From: Max Heimbrock <43608204+MaxHeimbrock@users.noreply.github.com> Date: Thu, 16 Jul 2026 17:54:33 +0200 Subject: [PATCH 4/4] It works --- AGENTS.md | 2 +- Cargo.toml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 65a2568..1c82cba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ ## Building - `cargo run` builds and runs the app against the pinned, published LiveKit crates -- To build against a local `rust-sdks` checkout, uncomment the `[patch.crates-io]` block in _Cargo.toml_ (see "Building against a local rust-sdks" in _README.md_) +- To build against a local `rust-sdks` checkout, comment out the published `livekit`/`livekit-api` lines in _Cargo.toml_ and uncomment the `path` lines below them (see "Building against a local rust-sdks" in _README.md_) ## UI best practices diff --git a/Cargo.toml b/Cargo.toml index c1e1305..117bc0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,14 +18,14 @@ tokio = { version = "1", features = ["full", "parking_lot"] } # egui-wgpu 0.35 requires wgpu ^29.0; "29.0" resolves to a compatible 29.0.x. wgpu = "29.0" winit = { version = "0.30.13", features = [ "android-native-activity" ] } -# livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } -# livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } +livekit = { version = "0.7.49", features = ["rustls-tls-native-roots"] } +livekit-api = { version = "0.5.4", default-features = false, features = ["access-token"] } # For local SDK development, comment out the two lines above and uncomment these # (clone https://github.com/livekit/rust-sdks to ../rust-sdks first; see # "Building against a local rust-sdks" in README.md): -livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } -livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } +# livekit = { path = "../rust-sdks/livekit", features = ["rustls-tls-native-roots"] } +# livekit-api = { path = "../rust-sdks/livekit-api", default-features = false, features = ["access-token"] } [package.metadata.bundle] name = "LiveKit Client"