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
Conversation
ffd28f6 to
9ce28f6
Compare
| pipewire | ||
| libepoxy | ||
| libgbm | ||
| libGL | ||
| libxdamage | ||
| libxfixes | ||
| libxrandr | ||
| libxtst | ||
| libxext | ||
| libxcomposite | ||
| xorg.libX11 | ||
| xorg.libXi |
There was a problem hiding this comment.
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?
9ce28f6 to
8cc650c
Compare
8cc650c to
bd4892a
Compare
| 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 |
There was a problem hiding this comment.
Is this required for darwin builds too?
There was a problem hiding this comment.
Oops, that should be mac, not linux64. But otherwise, yes - these directories are no longer extant by default.
Fixed.
bd4892a to
28a9fef
Compare
|
7fbeba2 to
f586b06
Compare
|
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. |
17d3d5c to
493e359
Compare
|
Temporarily targeting 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). |
| defines = [ "PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0" ] | ||
| - cflags = [] | ||
| - ldflags = [] | ||
| + cflags = [ "-fvisibility=default" ] |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!
6379d58 to
87b5289
Compare
87b5289 to
9217a74
Compare
|
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? |
|
desktop-app/tg_owt#167 Seems to be the same issue. Trying a build with the linked patch now. |
41b5f73 to
17a0eef
Compare
…, enable x11 and pipewire
17a0eef to
6a6b02f
Compare
There was a problem hiding this comment.
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...
Edit 2: fixed by patching in the correct header paths
Changelogs: - https://github.com/zed-industries/zed/releases/tag/v0.228.0 - https://github.com/zed-industries/zed/releases/tag/v0.227.1 Co-Authored-By: Aiden Schembri <aidsch0605@outlook.com>
9a2790b to
048cd37
Compare
|
|
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
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.