From 22194a000ac877c9a29096cffd215e52a06a6b40 Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Fri, 25 Jan 2019 10:56:36 -0500 Subject: [PATCH 1/2] Fix gitignore so ripgrep works ripgrep was failing to search in the bindgen repo: ``` ./.gitignore: line 19: error parsing glob '**.orig': invalid use of **; must be one path component ``` Per the gitignore docs it seems like ripgrep is correct and this line is invalid: https://git-scm.com/docs/gitignore#_pattern_format --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9141908668..f5c3381c81 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ __bindgen.* csmith-fuzzing/platform.info # Backups of test cases from C-Reduce -**.orig +**/*.orig From 4697025c25dbab8029e1fb36280ad46c88b1ad73 Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Fri, 25 Jan 2019 11:57:34 -0500 Subject: [PATCH 2/2] Produce a more useful error message when rustfmt can't be found. Fixes #1205 Prior to this change bindgen would simply print any error that occurred while attempting to run rustfmt straight to stderr using fmt::Debug. Combined with the fact that rustfmt is enabled by default now this meant that if rustfmt was missing or not working a cryptic error would be printed. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c24af26c40..e3906612c9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1835,7 +1835,7 @@ impl Bindings { writer.write(rustfmt_bindings.as_bytes())?; }, Err(err) => { - eprintln!("{:?}", err); + eprintln!("Failed to run rustfmt: {} (non-fatal, continuing)", err); writer.write(bindings.as_bytes())?; }, }