diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 274c8f03..774a0b5f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -27,26 +27,11 @@ jobs: run: cargo test - name: "matsadler/magnus" slug: magnus-head - ref: "05359fcd2369f014570f1e417c7c2d462625af5e" + ref: "627755429885eb1a84929e4d876f8cd8ec7303cf" run: cargo test os: ["ubuntu-latest", "windows-latest", "macos-latest"] rust: ["stable"] ruby: ["2.7", "3.2", "3.3"] - exclude: - - os: windows-latest - ruby: "3.3" # remove this once 3.3 binaries are available for windows - repo: - name: "matsadler/magnus" - slug: magnus-head - ref: "05359fcd2369f014570f1e417c7c2d462625af5e" - run: cargo test - - os: windows-latest - ruby: "3.3" # remove this once 3.3 binaries are available for windows - repo: - name: "matsadler/magnus" - slug: magnus-0.5 - ref: "0.5.5" - run: cargo test runs-on: ${{ matrix.os }} steps: diff --git a/Rakefile b/Rakefile index 50339347..c66acce9 100644 --- a/Rakefile +++ b/Rakefile @@ -30,6 +30,7 @@ namespace :test do cargo_test_task "rb-sys-tests" cargo_test_task "rb-sys-env" cargo_test_task "rb-sys-test-helpers" + cargo_test_task "rb-sys", "--all-targets", "--features", "bindgen-impl-debug,link-ruby" # Cover debian use case desc "Test against all installed Rubies" task :rubies do diff --git a/crates/rb-sys-build/src/bindings/stable_api.rs b/crates/rb-sys-build/src/bindings/stable_api.rs index 88a5aadb..fe5afea4 100644 --- a/crates/rb-sys-build/src/bindings/stable_api.rs +++ b/crates/rb-sys-build/src/bindings/stable_api.rs @@ -122,6 +122,22 @@ pub fn categorize_bindings(syntax: &mut syn::File) { excluded_items.push(item); } } + + // Perform a pass on all std::fmt::Debug implementations to fully qualify opaque structs + for item in excluded_items.iter_mut() { + if let syn::Item::Impl(ref mut impl_item) = item { + if let Some((_, syn::Path { segments, .. }, _)) = impl_item.trait_.as_ref() { + if segments.iter().any(|segment| segment.ident == "Debug") { + if let syn::Type::Path(ref mut path) = *impl_item.self_ty { + if opaque_idents_to_swap.contains(&path.to_token_stream().to_string()) { + *impl_item.self_ty = syn::parse_quote! { crate::internal::#path }; + } + } + } + } + } + } + *syntax = syn::parse_quote! { /// Contains all items that are not yet categorized by ABI stability. /// These items are candidates for promotion to `stable` or `unstable`