Skip to content

livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2026-03-12, enable x11 and pipewire, zed-editor: 0.226.5 -> 0.228.0#478907

Merged
GaetanLepage merged 2 commits intoNixOS:masterfrom
jrobsonchase:update-webrtc
Mar 23, 2026
Merged

livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2026-03-12, enable x11 and pipewire, zed-editor: 0.226.5 -> 0.228.0#478907
GaetanLepage merged 2 commits intoNixOS:masterfrom
jrobsonchase:update-webrtc

Conversation

@jrobsonchase
Copy link
Copy Markdown
Contributor

@jrobsonchase jrobsonchase commented Jan 11, 2026

Update livekit-libwebrtc to version 137. Also enable x11 and pipewire.

This is needed for use of libwebrtc's DesktopCapturer in Zed (zed-industries/zed#42670).

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Jan 11, 2026
@jrobsonchase jrobsonchase force-pushed the update-webrtc branch 2 times, most recently from ffd28f6 to 9ce28f6 Compare January 11, 2026 20:08
Comment on lines +201 to +212
pipewire
libepoxy
libgbm
libGL
libxdamage
libxfixes
libxrandr
libxtst
libxext
libxcomposite
xorg.libX11
xorg.libXi
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buncha new dependencies needed for the rtc_use_pipewire=true and rtc_use_x11=true change.

Are those options always something that we want? Or should they be configurable, producing multiple flavors of libwebrtc?

@jrobsonchase jrobsonchase changed the title wip: update livekit-libwebrtc livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2025-11-24, enable x11 and pipewire Jan 12, 2026
@jrobsonchase jrobsonchase marked this pull request as ready for review January 12, 2026 14:56
@nixpkgs-ci nixpkgs-ci bot requested review from WeetHet and niklaskorz January 12, 2026 14:56
ln -sf ${lib.getExe gn} buildtools/linux64/gn
substituteInPlace build/toolchain/linux/BUILD.gn \
--replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p buildtools/linux64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required for darwin builds too?

Copy link
Copy Markdown
Contributor Author

@jrobsonchase jrobsonchase Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that should be mac, not linux64. But otherwise, yes - these directories are no longer extant by default.

Fixed.

@niklaskorz
Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 478907
Commit: 28a9fef3416b3dde8876ff24d3f0db0822577bd9


aarch64-darwin

❌ 4 packages failed to build:
  • livekit-libwebrtc
  • livekit-libwebrtc.dev
  • zed-editor
  • zed-editor.remote_server

Error logs: `aarch64-darwin`
livekit-libwebrtc
patching file third_party/dav1d/BUILD.gn
applying patch /nix/store/lnfqqcqmgqipa4iblpv93d0gw3qf4zws-0001-shared-libraries.patch
patching file BUILD.gn
patching script interpreter paths in build/toolchain/apple/linker_driver.py
build/toolchain/apple/linker_driver.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/2z6flh9lzw7bq5z7vs8bl49qavi7p80q-python3-3.13.11-env/bin/python3"
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Updating Autotools / GNU config script to a newer upstream version: ./third_party/nasm/autoconf/helpers/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./third_party/breakpad/breakpad/autotools/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./third_party/nasm/autoconf/helpers/config.guess
Updating Autotools / GNU config script to a newer upstream version: ./third_party/breakpad/breakpad/autotools/config.guess
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
gn flags: is_debug=false rtc_include_tests=false target_os=\"mac\" target_cpu=\"arm64\" treat_warnings_as_errors=false rtc_enable_protobuf=false rtc_include_tests=false rtc_build_examples=false rtc_build_tools=false rtc_libvpx_build_vp9=true enable_libaom=true use_dummy_lastchange=true is_component_build=true enable_stripping=true rtc_use_h264=true rtc_use_h265=true use_custom_libcxx=false use_custom_libcxx_for_host=false use_llvm_libatomic=false use_libcxx_modules=false use_rtti=true mac_deployment_target=\"14.0\" rtc_enable_symbol_export=true rtc_enable_objc_symbol_export=true rtc_include_dav1d_in_internal_decoder_factory=true clang_use_chrome_plugins=false use_lld=false clang_base_path=\"/nix/store/8yy15sk3826gb00zp44xxrm8by9i3ia0-clang-wrapper-21.1.7\"
Generating compile_commands took 45ms
Done. Made 2251 targets from 400 files in 3918ms
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j6 :default api/audio_codecs:builtin_audio_decoder_factory api/task_queue:default_task_queue_factory sdk:native_api sdk:default_codec_factory_objc pc:peer_connection sdk:videocapture_objc sdk:mac_framework_objc
ninja: error: '../../../../../../../store/8yy15sk3826gb00zp44xxrm8by9i3ia0-clang-wrapper-21.1.7/lib/clang/21/lib/darwin/libclang_rt.osx.a', needed by 'obj/third_party/protobuf/libprotoc_lib.a', missing and no known rule to make it

@jrobsonchase jrobsonchase force-pushed the update-webrtc branch 2 times, most recently from 7fbeba2 to f586b06 Compare January 12, 2026 19:44
@jrobsonchase
Copy link
Copy Markdown
Contributor Author

Oh, hm. I think this will break the zed build until the PR that requires it gets merged... bit of a chicken-and-egg problem.

I think we'll have to get the PR merged on the zed side with an override, and then do the zed and libwebrtc version bumps simultaneously.

@jrobsonchase jrobsonchase force-pushed the update-webrtc branch 3 times, most recently from 17d3d5c to 493e359 Compare January 15, 2026 16:19
@jrobsonchase
Copy link
Copy Markdown
Contributor Author

Temporarily targeting zed-editor at the branch that's primed to use this new libwebrtc version.

Setting this PR back in draft until that merges, but the work needed to update zed after it does is already done and verified (at least by me on linux).

@jrobsonchase jrobsonchase marked this pull request as draft January 15, 2026 18:52
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 25, 2026
defines = [ "PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0" ]
- cflags = []
- ldflags = []
+ cflags = [ "-fvisibility=default" ]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have recently fast-forwarded Zed's dependency on livekit/rust-sdks and have included your changes from this PR in Zed proper (the commit: zed-industries/zed@641ef1f). FWIW I have made you a co-author @jrobsonchase. Anyhow, what we, NixOS users as Zed, have recently noticed is that linking libwebrtc as an SO with -fvisibility=default and rtc_use_pipewire = true causes the resultant libwebrtc.so to export pipewire symbols that you would normally expect in libpipewire.so:

$ ~/d/zed @0d215f250e• ❱ nm -D /nix/store/3wnqb79nwzh5gk7wkvx9l1sns8i9c5g5-livekit-libwebrtc-137-unstable-2025-11-24-dev/lib/libwebrtc.so 2>/dev/null | grep -i "pw_\|pipewire" | head -20
00000000007cec20 W pw_context_connect
00000000007cec30 W pw_context_connect_fd
00000000007cec00 W pw_context_destroy
00000000007cec10 W pw_context_new
00000000007cea50 W pw_core_disconnect
00000000007cea90 W pw_get_library_version
00000000007cea80 W pw_init
00000000007cea60 W pw_loop_destroy
00000000007cea70 W pw_loop_new
00000000007ceaa0 W pw_properties_new_string
00000000007cec40 W pw_proxy_destroy
00000000007ceab0 W pw_stream_add_listener
00000000007ceac0 W pw_stream_connect
00000000007ceae0 W pw_stream_dequeue_buffer
00000000007ceaf0 W pw_stream_destroy
00000000007cead0 W pw_stream_disconnect
00000000007ceb40 W pw_stream_get_node_id
00000000007ceb50 W pw_stream_get_state
00000000007ceb00 W pw_stream_new
00000000007ceb10 W pw_stream_queue_buffer

This in turns causes a null pointer dereference when rodio/cpal is trying to initialize a default audio device (input or output) since the loader seems to use libwebrtc.so exported pipewire stubs as pipewire symbols when dlopening pipewire ALSA plugin. Given that these are not yet resolved in libwebrtc.so - correct me if I'm wrong here but it seems that webrtc patches as the pointers in said stubs when we first request pipewire usage in libwebrtc - we deref address of 0x0 and crash.

My best take on this so far is to surgically hide the problematic symbols via a version script, but perhaps there's a better way? Looking forward to your thoughts on this!

Copy link
Copy Markdown
Contributor Author

@jrobsonchase jrobsonchase Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the next line in that patch, it's also adding additional linker args for some other shared libraries that it depends on. I wonder if those libraries were in a similar situation, and adding pipewire there might be a better approach?

Mostly a shot in the dark here - I wasn't involved with the original build of this in nixpkgs. @niklaskorz or @WeetHet would probably have a better idea.

For now though, I'll go ahead and pull in your version script!

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 6, 2026
@niklaskorz niklaskorz changed the title livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2025-11-24, enable x11 and pipewire livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2026-03-12, enable x11 and pipewire Mar 20, 2026
@jrobsonchase
Copy link
Copy Markdown
Contributor Author

jrobsonchase commented Mar 20, 2026

I'll fix the commit history here in a bit. The bigger problem is that when I merge master, it now fails to build 🫤

I'll push that up now that everything else seems to evaluate/build in its current state.

Seems like it's failing to find pipewire symbols now?

@jrobsonchase
Copy link
Copy Markdown
Contributor Author

desktop-app/tg_owt#167 Seems to be the same issue. Trying a build with the linked patch now.

@jrobsonchase jrobsonchase force-pushed the update-webrtc branch 2 times, most recently from 41b5f73 to 17a0eef Compare March 20, 2026 17:06
@jrobsonchase jrobsonchase marked this pull request as ready for review March 20, 2026 17:52
@niklaskorz niklaskorz changed the title livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2026-03-12, enable x11 and pipewire livekit-libwebrtc: 125-unstable-2025-07-25 -> 137-unstable-2026-03-12, enable x11 and pipewire, zed-editor: 0.226.5 -> 0.228.0 Mar 22, 2026
@nixpkgs-ci nixpkgs-ci bot requested a review from GaetanLepage March 22, 2026 18:58
@nixpkgs-ci nixpkgs-ci bot added the 8.has: package (update) This PR updates a package to a newer version label Mar 22, 2026
Copy link
Copy Markdown
Member

@niklaskorz niklaskorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine on darwin, but a header included by zed-editor fails to find gio from glib eventhough it's in the zed-editor buildInputs:

zed-editor>   cargo:warning=In file included from /nix/store/wrx5m9x5z1bndfg85w6fiv1w6fr4zhjz-livekit-libwebrtc-137-unstable-2026-03-12-dev/include/modules/desktop_capture/desktop_capture_metadata.h:15,
zed-editor>   cargo:warning=                 from /nix/store/wrx5m9x5z1bndfg85w6fiv1w6fr4zhjz-livekit-libwebrtc-137-unstable-2026-03-12-dev/include/modules/desktop_capture/desktop_capturer.h:26,
zed-editor>   cargo:warning=                 from ./include/livekit/desktop_capturer.h:20,
zed-editor>   cargo:warning=                 from src/desktop_capturer.cpp:17:
zed-editor>   cargo:warning=/nix/store/wrx5m9x5z1bndfg85w6fiv1w6fr4zhjz-livekit-libwebrtc-137-unstable-2026-03-12-dev/include/modules/portal/xdg_session_details.h:14:10: fatal error: gio/gio.h: No such file or directory
zed-editor>   cargo:warning=   14 | #include <gio/gio.h>
zed-editor>   cargo:warning=      |          ^~~~~~~~~~~
zed-editor>   cargo:warning=compilation terminated.

Edit: that's an issue in the webrtc-sys crate which tries to be "smart" by using the system's absolute glib path instead of pkg-config...

https://github.com/livekit/rust-sdks/blob/e96d7c2adbff9ad7f9ed6519b776c9557ee65a24/webrtc-sys/build.rs#L428-L452

Edit 2: fixed by patching in the correct header paths

@niklaskorz
Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 478907
Commit: 048cd370e88a865e9907bf51153d2f2ef854d866


x86_64-linux

✅ 5 packages built:
  • livekit-libwebrtc
  • livekit-libwebrtc.dev
  • zed-editor
  • zed-editor-fhs
  • zed-editor.remote_server

@niklaskorz
Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 478907
Commit: 048cd370e88a865e9907bf51153d2f2ef854d866


aarch64-darwin

✅ 4 packages built:
  • livekit-libwebrtc
  • livekit-libwebrtc.dev
  • zed-editor
  • zed-editor.remote_server

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Mar 23, 2026
@GaetanLepage GaetanLepage added this pull request to the merge queue Mar 23, 2026
@schembriaiden schembriaiden removed the 1.severity: blocker This is preventing another PR or issue from being completed label Mar 23, 2026
Merged via the queue into NixOS:master with commit 4029a71 Mar 23, 2026
34 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants