Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve bindgen-cli error handling #625

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading