mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #16880 - froydnj:bindgen-informative-failure, r=emilio
provide more information when bindgen fails Providing the flags we passed into clang can be informative for double-checking that we set everything up correctly. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- 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/16880) <!-- Reviewable:end -->
This commit is contained in:
commit
0388e11db2
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue