Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: libwebrtc-sys conflicts with other crates that use C/C++ #364

Open
maxbrunsfeld opened this issue Jul 9, 2024 · 1 comment
Open

Comments

@maxbrunsfeld
Copy link
Contributor

maxbrunsfeld commented Jul 9, 2024

It looks like the prebuilt WebRTC library downloaded by the libwebrtc-sys build links the windows C Runtime Library statically, as opposed to dynamically, which causes linker errors when using other Rust crates that link to the C Runtime Library.

When compiling an application that uses both LiveKit and other crates that include C code via build.rs and the cc crate, the Zed project is getting a large number of linker errors like this:

libcpmt.lib(xstol.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in libtree_sitter_yaml-df6b0adf8f009e8f.rlib(2e40c9e35e9506f4-scanner.o)

Here is the CI build where this error (and many similar ones) occurred.

The error mentions an object file libtree_sitter_yaml-..-scanner.o, which is just one of the crates that Zed depends on that uses C++. Here is the build.rs for that crate. You can see it's pretty standard - just including some C code via the cc crate.

@WeetHet
Copy link

WeetHet commented Nov 14, 2024

Could you try using crt-static, as described in #277?

SomeoneToIgnore added a commit to zed-industries/zed that referenced this issue Nov 15, 2024
See livekit/rust-sdks#355

Todo:

* [x] make `call` / `live_kit_client` crates use the livekit rust sdk
* [x] create a fake version of livekit rust API for integration tests
* [x] capture local audio
* [x] play remote audio
* [x] capture local video tracks
* [x] play remote video tracks
* [x] tests passing
* bugs
* [x] deafening does not work
(livekit/rust-sdks#359)
* [x] mute and speaking status are not replicated properly:
(livekit/rust-sdks#358)
* [x] **linux** - crash due to symbol conflict between WebRTC's
BoringSSL and libcurl's openssl
(livekit/rust-sdks#89)
* [x] **linux** - libwebrtc-sys adds undesired dependencies on `libGL`
and `libXext`
* [x] **windows** - linker error, maybe related to the C++ stdlib
(livekit/rust-sdks#364)
        ```
libwebrtc_sys-54978c6ad5066a35.rlib(video_frame.obj) : error LNK2038:
mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't
match value 'MD_DynamicRelease' in
libtree_sitter_yaml-df6b0adf8f009e8f.rlib(2e40c9e35e9506f4-scanner.o)
        ```
    * [x] audio problems

Release Notes:

- Switch from Swift to Rust LiveKit SDK 🦀

---------

Co-authored-by: Mikayla Maki <[email protected]>
Co-authored-by: Conrad Irwin <[email protected]>
Co-authored-by: Kirill Bulatov <[email protected]>
Co-authored-by: Michael Sloan <[email protected]>
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

No branches or pull requests

2 participants