Add headless Linux build path#1024
Conversation
|
Looks good to me. That failing test has been there before, no worries. There's a merge conflict – please resolve it and we're good to go. |
|
@reenboog |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f720ceb39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| async = ["livekit-api/signal-client-async"] | ||
| tokio = ["livekit-api/signal-client-tokio"] | ||
| dispatcher = ["livekit-api/signal-client-dispatcher"] | ||
| glib-main-loop = ["libwebrtc/glib-main-loop"] |
There was a problem hiding this comment.
Disable libwebrtc defaults for headless feature control
This adds a glib-main-loop feature toggle at the livekit level, but the libwebrtc dependency still uses its own default features, so cargo build -p livekit --no-default-features -F tokio will continue to enable libwebrtc’s default glib-main-loop path. In practice, headless Linux builds still pull GLib transitively unless libwebrtc is declared with default-features = false, which means the new documented headless flow is not actually enforced by this feature wiring.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
fixed in the following commit
…main-loop This change disables default features for the libwebrtc workspace dependency. Previously, when building livekit with '--no-default-features -F tokio', the libwebrtc workspace entry would still propagate its own default features (specifically glib-main-loop) to all workspace members. This caused headless Linux builds to unexpectedly pull in GLib and its system dependencies. Setting 'default-features = false' at the workspace level ensures that feature selection remains explicit and under the control of the target crate or example, while still allowing crates like 'local_audio' to enable it as needed. Verified with: - cargo tree -p livekit --no-default-features -F tokio -i glib (confirmed gone) - cargo build -p livekit --no-default-features -F tokio (confirmed working)
…4-findings Disable libwebrtc default features in workspace dependencies
Summary
glib-main-loopthroughlivekitwhile keeping it enabled by default for desktop-oriented consumersLK_HEADLESS=1handling inwebrtc-sys/build.rsto skip Linux desktop capturer sources, GLib/GIO probing, and X11 desktop-capture linkageglib-main-loopexplicitly so example behavior remains desktop-friendlyWhy
On Linux,
libwebrtcenablesglib-main-loopby default andlivekitinherited that behavior transitively. That made it impossible to build an intentionally headless Linux configuration without pulling in the GLib desktop path. This change preserves the existing default behavior while making the headless path explicit and supported.Headless Linux requires both pieces:
LK_HEADLESS=1changes the Linux native build path inwebrtc-sys--no-default-features -F tokiodisables the default desktop-orientedglib-main-loopfeature in the Rust dependency graphIn other words,
LK_HEADLESS=1by itself is not intended to change the default feature selection forlivekit.Validation
cargo build -p livekitLK_HEADLESS=1 cargo build -p livekit --no-default-features -F tokiocargo tree -p livekit -i glibshowsglibin the default buildLK_HEADLESS=1 cargo tree -p livekit --no-default-features -F tokio -i glibshowsglibabsent from the graph