Skip to content

Commit

Permalink
provide more information when bindgen fails
Browse files Browse the repository at this point in the history
Providing the flags we passed into clang can be informative for
double-checking that we set everything up correctly.
  • Loading branch information
froydnj committed May 15, 2017
1 parent dfb9396 commit 22db4b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/style/build_gecko.rs
Expand Up @@ -250,7 +250,14 @@ mod bindings {
return;
}
}
let mut result = builder.generate().expect("Unable to generate bindings").to_string();
let command_line_opts = builder.command_line_flags();
let result = builder.generate();
let mut result = match result {
Ok(bindings) => bindings.to_string(),
Err(_) => {
panic!("Failed to generate bindings, flags: {:?}", command_line_opts);
},
};
for fixup in fixups.iter() {
result = Regex::new(&format!(r"\b{}\b", fixup.pat)).unwrap().replace_all(&result, fixup.rep.as_str())
.into_owned().into();
Expand Down

0 comments on commit 22db4b4

Please sign in to comment.