diff --git a/.ruby-version b/.ruby-version index fb3198ba..2f9dd5fd 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-4.0.0-preview2 +ruby-4.0.0 diff --git a/crates/rb-sys-build/src/bindings.rs b/crates/rb-sys-build/src/bindings.rs index 4d0dbc01..7b727338 100644 --- a/crates/rb-sys-build/src/bindings.rs +++ b/crates/rb-sys-build/src/bindings.rs @@ -141,19 +141,11 @@ fn clean_docs(rbconfig: &RbConfig, syntax: &mut syn::File) { } fn default_bindgen(clang_args: Vec, rbconfig: &RbConfig) -> bindgen::Builder { - // Disable layout tests and Debug impl for Ruby 2.7 and 3.0 on Windows MinGW due to type incompatibilities - let is_old_ruby_windows_mingw = if cfg!(target_os = "windows") && !is_msvc() { - if let Some((major, minor)) = rbconfig.major_minor() { - (major == 2 && minor == 7) || (major == 3 && minor == 0) - } else { - false - } - } else { - false - }; + // Disable layout tests and Debug impl on Windows MinGW due to packed struct layout incompatibilities + let is_windows_mingw = cfg!(target_os = "windows") && !is_msvc(); - let enable_layout_tests = !is_old_ruby_windows_mingw && cfg!(feature = "bindgen-layout-tests"); - let impl_debug = !is_old_ruby_windows_mingw && cfg!(feature = "bindgen-impl-debug"); + let enable_layout_tests = !is_windows_mingw && cfg!(feature = "bindgen-layout-tests"); + let impl_debug = !is_windows_mingw && cfg!(feature = "bindgen-impl-debug"); let mut bindings = bindgen::Builder::default() .rustified_enum(".*") @@ -167,6 +159,8 @@ fn default_bindgen(clang_args: Vec, rbconfig: &RbConfig) -> bindgen::Bui .blocklist_item("^__pthread_.*") .blocklist_item("^pthread_.*") .blocklist_item("^rb_native.*") + .blocklist_type("INET_PORT_RESERVATION_INSTANCE") + .blocklist_type("PINET_PORT_RESERVATION_INSTANCE") .opaque_type("^__sFILE$") .merge_extern_blocks(true) .generate_comments(true) diff --git a/flake.lock b/flake.lock index c42e6e2d..db924c54 100644 --- a/flake.lock +++ b/flake.lock @@ -54,11 +54,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753939845, - "narHash": "sha256-K2ViRJfdVGE8tpJejs8Qpvvejks1+A4GQej/lBk5y7I=", + "lastModified": 1767379071, + "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "94def634a20494ee057c76998843c015909d6311", + "rev": "fb7944c166a3b630f177938e478f0378e64ce108", "type": "github" }, "original": { @@ -77,11 +77,11 @@ ] }, "locked": { - "lastModified": 1765587275, - "narHash": "sha256-vmT73WDxHIoVhMIO6KyxkAUsN3YQLZfnpLU/T79NUUw=", + "lastModified": 1766728475, + "narHash": "sha256-9y9WBiQONK9TgD4lu8SW6TpcfEaJTxEs1HjhC4s4vnY=", "owner": "bobvanderlinden", "repo": "nixpkgs-ruby", - "rev": "6ae67be3862a2442cce588bea8e5f7ae88b54870", + "rev": "f167828eab19c3a7e3faa066a140d92e307f7b16", "type": "github" }, "original": { @@ -119,11 +119,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1754016903, - "narHash": "sha256-mRB5OOx7H5kFwW8Qtc/7dO3qHsBQtZ/eYQEj93/Noo8=", + "lastModified": 1767581716, + "narHash": "sha256-FUbiUzdrGkLou37OGfb4vCLPnqdSIvtmJBxjh2iljiE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "ddd488184f01603b712ddbb6dc9fe0b8447eb7fc", + "rev": "1d3f83babdd21e16bf5cfe0f1efcb4f49ee1bc2c", "type": "github" }, "original": {