Commit 2540efe
authored
Remove default link-time dependency on GLib (#1144)
### Before you submit your PR
Make sure the following is true before submitting your PR:
- [x] I have read the [contributing
guidelines](https://github.com/livekit/rust-sdks/blob/main/CONTRIBUTING.md)
and validated that this PR will be accepted.
- [x] I have read and followed the principles regarding breaking
changes, testing, and code quality.
### PR Description
The webrtc-sys build script used pkg_config::probe_library for
glib-2.0/gobject-2.0/gio-2.0, which emitted cargo:rustc-link-lib
directives even though only the headers are required at build time.
Switch to pkg_config::Config::new().cargo_metadata(false) so the include
paths are still discovered but no link metadata is emitted.
Drop glib-main-loop from libwebrtc's default features and re-expose it
as an opt-in passthrough on the top-level livekit crate. The
screensharing example enables it explicitly. Note that the original
change
(ca86d4c)
was somewhat broken on arrival, since it did not provide any way for a
`livekit` consumer to opt out of the internal GLib main loop.
Fixes: #1129
### Breaking changes
Consumers of `livekit` or `libwebrtc` that rely on Wayland screen
sharing must now enable the `glib-main-loop` feature (if they do not
have their own GLib main loop).
### MSRV
No change.
### Testing
Validated that a trivial crate that depends on `livekit` no longer pulls
in `glib` as a dependency.
Built a cdylib on Linux aarch64 in a build environment where the linker
does not use `--as-needed` (or it simply does not work as expected), and
validated that the resulting binary does not include library
dependencies on GLib. See the [build
artifacts](https://github.com/foxglove/foxglove-sdk/actions/runs/27042873647)
from foxglove/foxglove-sdk#1292
(`lib/libfoxglove.so`).1 parent 527aba5 commit 2540efe
5 files changed
Lines changed: 27 additions & 6 deletions
File tree
- .changeset
- examples/screensharing
- libwebrtc
- livekit
- webrtc-sys
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
0 commit comments