diff options
-rw-r--r-- | components/style/build_gecko.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index bee55793216..193be7b2744 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -42,7 +42,13 @@ mod bindings { lazy_static! { static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap(); - static ref DISTDIR_PATH: PathBuf = PathBuf::from(env::var("MOZ_DIST").unwrap()); + static ref DISTDIR_PATH: PathBuf = { + let path = PathBuf::from(env::var("MOZ_DIST").unwrap()); + if !path.is_absolute() || !path.is_dir() { + panic!("MOZ_DIST must be an absolute directory, was: {}", path.display()); + } + path + }; static ref SEARCH_PATHS: Vec<PathBuf> = vec![ DISTDIR_PATH.join("include"), DISTDIR_PATH.join("include/nspr"), |