Skip to content

Commit 0780856

Browse files
yuv-sys: actionable error when libyuv submodule is not initialized (#1347)
## Problem A fresh `git clone` without `--recursive` leaves `yuv-sys/libyuv` empty. The build script copies the empty directory and fails several calls later with: thread 'main' panicked at yuv-sys/build.rs:140:10: called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" } Nothing in the error points at the submodule as the cause, and the README build instructions don't mention `--recursive`. CI/container builds don't hit this because the Dockerfile initializes submodules explicitly — it only affects local builds from a fresh clone. ## Fix Check for `libyuv/include/libyuv.h` before the copy and panic with the remedy. ## Verification - `git submodule deinit -f yuv-sys/libyuv` → build fails with the new message - `git submodule update --init` → clean build succeeds (macOS, aarch64) --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 338d9c0 commit 0780856

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
yuv-sys: patch
3+
livekit-ffi: patch
4+
imgproc: patch
5+
---
6+
7+
yuv-sys: fail with an actionable error when the libyuv submodule is not initialized

yuv-sys/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ fn main() {
134134
let is_aarch64 = target_arch == "aarch64";
135135
let is_arm32 = target_arch == "arm";
136136

137+
// The vendored libyuv submodule must be initialized before we copy it.
138+
if !Path::new("libyuv").join("include/libyuv.h").exists() {
139+
panic!(
140+
"yuv-sys/libyuv submodule is missing or empty. \
141+
Run: git submodule update --init --recursive"
142+
);
143+
}
137144
let cloned = clone_if_needed(&output_dir, &libyuv_dir);
138145

139146
let include_files = fs::read_dir(include_dir.join("libyuv"))

0 commit comments

Comments
 (0)