mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #14563 - upsuper:buildtime-bindgen, r=emilio
Add asserts to make failure clearer Gecko currently doesn't pass absolute path for `MOZ_DIST`, which leads to obscure panic when running the build script. This patch adds some assertions so that failures around this would be clearer. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14563) <!-- Reviewable:end -->
This commit is contained in:
commit
a6cfec972f
1 changed files with 7 additions and 1 deletions
|
@ -42,7 +42,13 @@ mod bindings {
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap();
|
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![
|
static ref SEARCH_PATHS: Vec<PathBuf> = vec![
|
||||||
DISTDIR_PATH.join("include"),
|
DISTDIR_PATH.join("include"),
|
||||||
DISTDIR_PATH.join("include/nspr"),
|
DISTDIR_PATH.join("include/nspr"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue