Build Failure in webrtc-sys Due to Missing video/config/video_encoder_config.h and msvc_spectre_libs Issues on Windows #29901
termiboros
started this conversation in
Help on Windows
Replies: 2 comments 2 replies
-
tsk. when shall this issue will fix? |
Beta Was this translation helpful? Give feedback.
2 replies
-
This error happens to me when I don't open the correct terminal, as mentioned in the windows docs:
In my case, the full developer shell is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Issue.
I’m encountering a build failure when compiling the Zed project (which depends on webrtc-sys from livekit-rust-sdks at commit 80bb8f4c) on Windows with MSVC. The primary issue is a fatal error C1083 in webrtc-sys because the header video/config/video_encoder_config.h cannot be found. Additionally, I faced an issue with msvc_spectre_libs failing to locate Spectre-mitigated libraries, which I resolved with a workaround, but it may indicate a broader configuration problem. I’m reporting both issues as they occurred during the same build process and may be related to the webrtc-sys setup in this repository.
Environment
OS: Windows 11
Rust Version: stable-x86_64-pc-windows-msvc (default)
1.86-x86_64-pc-windows-msvc (active)
MSVC Version: 14.43.34808 (from Visual Studio Build Tools 2022)
Target: x86_64-pc-windows-msvc
Project: Zed (cloned from https://github.com/zed-industries/zed)
Repository: livekit-rust-sdks (commit 80bb8f4c9112789f7c24cc98d8423010977806a6)
Crate: webrtc-sys v0.3.7, msvc_spectre_libs v0.1.3
Build Command: cargo build --release -
Description
Issue 1:
webrtc-sys
Build Failure [C1083: Missing video_encoder_config.h]When building
webrtc-sys
the MSVC compiler fails with the following error:This error occurs during the compilation of multiple C++ files (e.g., peer_connection.cpp, peer_connection_factory.cpp, rtp_receiver.cpp, rtp_sender.cpp, rtp_transceiver.cpp, webrtc.cpp, frame_cryptor.cpp). The include paths specified in the cc-rs build command are:
I checked the WebRTC include directory (...\win-x64-release\include), but video/config/video_encoder_config.h is missing or not in the expected video/config subdirectory. This suggests either:
The WebRTC source at commit 80bb8f4c is incomplete.
The webrtc-sys build script (build.rs) is not setting the correct include path for video/config.
A bug in the pinned commit.
Additionally, there are non-fatal warnings:
These indicate Clang-specific pragmas that MSVC doesn’t recognize, suggesting potential portability issues.
Issue 2:
msvc_spectre_libs
Failure [Resolved with Workaround]The msvc_spectre_libs crate (v0.1.3) failed to locate Spectre-mitigated libraries, causing a panic in its build.rs:
No spectre-mitigated libs were found. Please modify the VS Installation to add these.
I resolved this by patching
msvc_spectre_libs
to hardcode the path to my Spectre libraries:let spectre_libs = Path::new("C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\lib\\spectre\\x64");
I applied this patch via
[patch.crates-io]
in Cargo.toml on zed:This allowed webrtc-sys to compile successfully, but the debug output from my patched build.rs (using println!) is not appearing, possibly due to Cargo caching or output suppression.
Reproduce
Step to Reproduce:
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
cargo build --release --target x86_64-pc-windows-msvc --verbose
Expected Behavior:
webrtc-sys
should compile without missing header errors, with all WebRTC headers (including - -video/config/video_encoder_config.h
) available and correctly included.msvc_spectre_libs
should detect Spectre-mitigated libraries automatically without requiring a hardcoded path.Actual Behavior
Suggested Fixes
For webrtc-sys:
Update webrtc-sys/build.rs to include the video/config subdirectory in the cc::Build configuration, e.g.:
.include("path/to/webrtc/include/video/config")
For msvc_spectre_libs:
Improve the library detection logic in msvc_spectre_libs to find Spectre libraries [e.g., at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.29.30133\lib\spectre\x64] without hardcoding.
Ensure build script output is visible even when cached.
Additional Context
The Zed project pins webrtc-sys to commit 80bb8f4c. Switching to a newer commit or crates.io version (webrtc-sys = "0.3.7") might resolve the issue but could break Zed’s compatibility.
My MSVC version (14.43.34808) is newer than the Spectre library path (14.29.30133), but the libraries are present and work with the patch.
I’m building in the x64 Native Tools Command Prompt with the LIB environment variable set to include the Spectre library path.
Logs
Logs
Relevant build output:
Beta Was this translation helpful? Give feedback.
All reactions