open-standards/jouledesk/jouledesk-rs/crates/jouledesk-livekit/build.rs
Transaction Science c8db7f4efa jouledesk-livekit: prove the room binding live — real LiveKit run
Drives all four seams over a real WebRTC room against a live livekit-server:
join under a minted token, gate each turn OUTSIDE the model (served vs refused
for unheld-capability / over-ceiling), meter the model calls, seal one
efficiency/1 that verifies under the steward key. examples/live_room.rs is the
runnable proof (data-plane turns → gate/meter/seal, receipt verified).

Clears two upstream blockers so `--features livekit` builds + runs on macOS:
- vendor/libwebrtc: libwebrtc 0.3.38 omits user_data that webrtc-sys 0.3.36
  requires (broken upstream release pair); patched additively + [patch.crates-io].
- build.rs: emit -ObjC so libwebrtc's ObjC categories force-load, else
  PeerConnectionFactory init crashes on an unrecognized selector.

Default build + tests are unaffected (the feature stays off by default).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-06 04:13:40 -04:00

13 lines
760 B
Rust

fn main() {
// The prebuilt libwebrtc (pulled by webrtc-sys) ships Objective-C categories in a
// static library — e.g. the NSString/abseil-string-view bridge used by the macOS
// video-encoder factory. Without `-ObjC`, the linker drops those category object
// files, so their selectors are never registered and the first call crashes with
// `unrecognized selector +[NSString stringForAbslStringView:]` while building the
// PeerConnectionFactory. Force-load ObjC members from the static libs to fix it.
let macos = std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("macos");
let livekit = std::env::var("CARGO_FEATURE_LIVEKIT").is_ok();
if macos && livekit {
println!("cargo:rustc-link-arg=-ObjC");
}
}