Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upParse errors in capi cause an unhelpful panic in the build script #24093
Labels
Comments
diff --git a/ports/libsimpleservo/capi/build.rs b/ports/libsimpleservo/capi/build.rs
index ad1bfa9e79..e0bb8e3458 100644
--- a/ports/libsimpleservo/capi/build.rs
+++ b/ports/libsimpleservo/capi/build.rs
@@ -17,11 +17,12 @@ fn main() {
let profile_dir = env::var("PROFILE").unwrap();
path.push(profile_dir);
path.push("simpleservo.h");
- cbindgen::Builder::new()
+ if let Ok(b) = cbindgen::Builder::new()
.with_crate(crate_dir)
.with_language(cbindgen::Language::C)
.exclude_item("OutputDebugStringA")
.generate()
- .expect("Unable to generate bindings")
- .write_to_file(path);
+ {
+ b.write_to_file(path);
+ }
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If there's a syntax error in any of the code in the capi crate, all you get to learn is this:
It would be much easier to not panic during the build script and find out the actual error during the normal build instead.