Skip to content

Commit

Permalink
Improve bindgen-cli error handling (#625)
Browse files Browse the repository at this point in the history
* Improve bindgen-cli error handling

* Satisfy clippy

* >= v0.69.5
  • Loading branch information
justsmth authored Dec 12, 2024
1 parent 3e83854 commit 0a697c5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,12 @@ impl Debug for BindingOptions {
fn verify_bindgen() -> Result<(), String> {
let result = execute_command("bindgen".as_ref(), &["--version".as_ref()]);
if !result.status {
if !result.executed {
if result.executed {
eprintln!(
"bindgen-cli exited with an error status:\nSTDOUT: {}\n\nSTDERR: {}",
result.stdout, result.stderr
);
} else {
eprintln!(
"Consider installing the bindgen-cli: \
`cargo install --force --locked bindgen-cli`\
Expand All @@ -722,12 +727,12 @@ fn verify_bindgen() -> Result<(), String> {
patch_version = version_parts[2].parse::<u32>().unwrap_or(0);
}
}
// We currently expect to support all bindgen versions >= 0.69.3
if major_version == 0 && (minor_version < 69 || (minor_version == 69 && patch_version < 3)) {
// We currently expect to support all bindgen versions >= 0.69.5
if major_version == 0 && (minor_version < 69 || (minor_version == 69 && patch_version < 5)) {
eprintln!(
"bindgen-cli was used. Detected version was: \
{major_version}.{minor_version}.{patch_version} \n\
If this is not the latest version, consider upgrading : \
Consider upgrading : \
`cargo install --force --locked bindgen-cli`\
\n\
See our User Guide for more information about bindgen:\
Expand Down

0 comments on commit 0a697c5

Please sign in to comment.