diff --git a/crates/re_renderer/build.rs b/crates/re_renderer/build.rs index d9c6b90c4b37..735199007501 100644 --- a/crates/re_renderer/build.rs +++ b/crates/re_renderer/build.rs @@ -19,6 +19,12 @@ use walkdir::{DirEntry, WalkDir}; // Mapping to cargo:rerun-if-changed with glob support fn rerun_if_changed(path: &str) { + // Workaround for windows verbatim paths not working with glob. + // Issue: https://github.com/rust-lang/glob/issues/111 + // Fix: https://github.com/rust-lang/glob/pull/112 + // Fixed on upstream, but no release containing the fix as of writing. + let path = path.trim_start_matches(r"\\?\"); + for path in glob::glob(path).unwrap() { println!("cargo:rerun-if-changed={}", path.unwrap().to_string_lossy()); } diff --git a/crates/re_web_server/build.rs b/crates/re_web_server/build.rs index 580a06a453f6..4f3fce5b1901 100644 --- a/crates/re_web_server/build.rs +++ b/crates/re_web_server/build.rs @@ -10,6 +10,12 @@ use std::{ // Mapping to cargo:rerun-if-changed with glob support fn rerun_if_changed(path: &str) { + // Workaround for windows verbatim paths not working with glob. + // Issue: https://github.com/rust-lang/glob/issues/111 + // Fix: https://github.com/rust-lang/glob/pull/112 + // Fixed on upstream, but no release containing the fix as of writing. + let path = path.trim_start_matches(r"\\?\"); + for path in glob::glob(path).unwrap() { println!("cargo:rerun-if-changed={}", path.unwrap().to_string_lossy()); }