From 717f25204a32f25263a800b06150ff5413c1613d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Fri, 5 Sep 2025 09:12:38 -0700 Subject: [PATCH] Disable bindgen version comment in generated bindings.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With us having CI check that the bindgen generated bindings are up-to-date, we can run into issues where we now see a CI failure just because they released a new patch version and now the generated bindings contain a slightly outdated version string in them. E.g.: --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.72.0 */ +/* automatically generated by rust-bindgen 0.72.1 */ This is annoying and a waste of time to tend to. Really the version string in there doesn't add any value: we basically know the major and minor version of bindgen that we used, because we specified it in our Cargo.toml and the patch level really shouldn't have any relevance. So disable the embedding of this version string into the generate bindings altogether. Signed-off-by: Daniel Müller --- build.rs | 1 + src/bindings.rs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build.rs b/build.rs index eaf5388..268a516 100644 --- a/build.rs +++ b/build.rs @@ -59,6 +59,7 @@ fn generate_bindings(src_dir: path::PathBuf) { bindgen::Builder::default() .rust_target(env!("CARGO_PKG_RUST_VERSION").parse().expect("valid")) + .disable_header_comment() .derive_default(true) .explicit_padding(true) .default_enum_style(bindgen::EnumVariation::Consts) diff --git a/src/bindings.rs b/src/bindings.rs index fad60c5..3dd8f73 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,5 +1,3 @@ -/* automatically generated by rust-bindgen 0.72.0 */ - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit {