in aws-lc-fips-sys/builder/main.rs [640:679]
fn verify_bindgen() -> Result<(), String> {
let result = execute_command("bindgen".as_ref(), &["--version".as_ref()]);
if !result.status {
if !result.executed {
eprintln!(
"Consider installing the bindgen-cli: \
`cargo install --force --locked bindgen-cli`\
\n\
See our User Guide for more information about bindgen:\
https://aws.github.io/aws-lc-rs/index.html"
);
}
return Err("External bindgen command failed.".to_string());
}
let mut major_version: u32 = 0;
let mut minor_version: u32 = 0;
let mut patch_version: u32 = 0;
let bindgen_version = result.stdout.split(' ').nth(1);
if let Some(version) = bindgen_version {
let version_parts: Vec<&str> = version.trim().split('.').collect();
if version_parts.len() == 3 {
major_version = version_parts[0].parse::<u32>().unwrap_or(0);
minor_version = version_parts[1].parse::<u32>().unwrap_or(0);
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)) {
eprintln!(
"bindgen-cli was used. Detected version was: \
{major_version}.{minor_version}.{patch_version} \n\
If this is not the latest version, consider upgrading : \
`cargo install --force --locked bindgen-cli`\
\n\
See our User Guide for more information about bindgen:\
https://aws.github.io/aws-lc-rs/index.html"
);
}
Ok(())
}