From f13a8dc7cc09d6e9398304baaaaff8307fa8c480 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 16 May 2017 07:19:53 -0500 Subject: [PATCH] servo: Merge #16880 - provide more information when bindgen fails (from froydnj:bindgen-informative-failure); r=emilio 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). Source-Repo: https://github.com/servo/servo Source-Revision: 0388e11db2532d41a71e184cb2a1f46e5107b8f5 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 54d3739a0fc67886697020d38fadddb049631b4c --- servo/components/style/build_gecko.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/servo/components/style/build_gecko.rs b/servo/components/style/build_gecko.rs index d32b3a9f62f7..6da76e25f42b 100644 --- a/servo/components/style/build_gecko.rs +++ b/servo/components/style/build_gecko.rs @@ -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();