Open jdm opened 5 years ago
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);
+ }
}
Thank you for pointing this out. You saved a rust rookie hours of unfruitful debugging
Oof, we should really apply this patch. Do you want to make a pull request with this change?
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.