bazel: simplify webrtc scratch patch

This commit is contained in:
starr-openai
2026-05-28 23:23:34 -07:00
parent ca2359d682
commit bc29349a63

View File

@@ -1,5 +1,5 @@
diff --git a/src/lib.rs b/src/lib.rs
index a240dd6..6e64dfd 100644
index a240dd6..7dcf631 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -89,7 +89,7 @@ pub fn custom_dir() -> Option<path::PathBuf> {
@@ -7,7 +7,7 @@ index a240dd6..6e64dfd 100644
/// This also has the benefit of not re-downloading the binaries for each crate
pub fn prebuilt_dir() -> path::PathBuf {
- let target_dir = scratch::path(SCRATH_PATH);
+ let target_dir = scratch_dir();
+ let target_dir = PathBuf::from(env::var("OUT_DIR").unwrap()).join(SCRATH_PATH);
path::Path::new(&target_dir).join(format!(
"livekit/{}-{}/{}",
webrtc_triple(),
@@ -16,17 +16,7 @@ index a240dd6..6e64dfd 100644
pub fn download_webrtc() -> Result<()> {
- let dir = scratch::path(SCRATH_PATH);
+ let dir = scratch_dir();
+ let dir = PathBuf::from(env::var("OUT_DIR").unwrap()).join(SCRATH_PATH);
// temporary fix to avoid github workflow issue
fs::create_dir_all(&dir).context("Failed to create scratch_path")?;
let flock = File::create(dir.join(".lock"))
@@ -233,5 +233,9 @@ pub fn download_webrtc() -> Result<()> {
Ok(())
}
+fn scratch_dir() -> PathBuf {
+ PathBuf::from(env::var("OUT_DIR").unwrap()).join(SCRATH_PATH)
+}
+
pub fn android_ndk_toolchain() -> Result<path::PathBuf> {
let host_os = host_os();