Skip to content

Add headless Linux build path#1024

Open
mikefaille wants to merge 2 commits intolivekit:mainfrom
mikefaille:headless-linux-support
Open

Add headless Linux build path#1024
mikefaille wants to merge 2 commits intolivekit:mainfrom
mikefaille:headless-linux-support

Conversation

@mikefaille
Copy link
Copy Markdown

@mikefaille mikefaille commented Apr 19, 2026

Summary

  • make headless Linux an explicit supported path without changing the default desktop build behavior
  • re-expose glib-main-loop through livekit while keeping it enabled by default for desktop-oriented consumers
  • add LK_HEADLESS=1 handling in webrtc-sys/build.rs to skip Linux desktop capturer sources, GLib/GIO probing, and X11 desktop-capture linkage
  • pin direct desktop examples back to glib-main-loop explicitly so example behavior remains desktop-friendly

Why

On Linux, libwebrtc enables glib-main-loop by default and livekit inherited 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=1 changes the Linux native build path in webrtc-sys
  • --no-default-features -F tokio disables the default desktop-oriented glib-main-loop feature in the Rust dependency graph

In other words, LK_HEADLESS=1 by itself is not intended to change the default feature selection for livekit.

Validation

  • cargo build -p livekit
  • LK_HEADLESS=1 cargo build -p livekit --no-default-features -F tokio
  • cargo tree -p livekit -i glib shows glib in the default build
  • LK_HEADLESS=1 cargo tree -p livekit --no-default-features -F tokio -i glib shows glib absent from the graph

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 19, 2026

CLA assistant check
All committers have signed the CLA.

@mikefaille mikefaille changed the title [codex] Add headless Linux build path Add headless Linux build path Apr 19, 2026
@mikefaille mikefaille marked this pull request as ready for review April 21, 2026 05:55
@mikefaille
Copy link
Copy Markdown
Author

There is one test failing but I don't part it's from this pr. @typester @ladvoc and @reenboog

@reenboog
Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants