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

Bindgen layout tests broken with bindgen v0.70 #455

Open
NoisyCoil opened this issue Nov 23, 2024 · 0 comments
Open

Bindgen layout tests broken with bindgen v0.70 #455

NoisyCoil opened this issue Nov 23, 2024 · 0 comments

Comments

@NoisyCoil
Copy link

NoisyCoil commented Nov 23, 2024

Hello. After updating bindgen to v0.70 in Debian, bindgen layout tests for rb-sys started failing. More precisely, they started to fail compiling at all. The compile errors I see are of the kind

 96s error[E0412]: cannot find type `RString` in this scope
 96s  --> /tmp/tmp.8KgGSkJnaY/target/x86_64-unknown-linux-gnu/debug/build/rb-sys-2ab3a78fa105e128/out/bindings-0.9.102-x86_64-linux-gnu-3.1.2.rs:1:103592
 96s   |
 96s 1 | ... _ : () = { ["Size of RString"] [:: std :: mem :: size_of :: < RString > () - 40usize] ; ["Alignment of RString"] [:: std :: mem :: al...
220s   |                                                ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
 97s error[E0412]: cannot find type `rb_sys__Opaque__RArray` in this scope
 97s  --> /tmp/tmp.8KgGSkJnaY/target/x86_64-unknown-linux-gnu/debug/build/rb-sys-2ab3a78fa105e128/out/bindings-0.9.102-x86_64-linux-gnu-3.1.2.rs:1:237821
 97s   |
 97s 1 | ...e__RArray"] [:: std :: mem :: align_of :: < rb_sys__Opaque__RArray > () - 8usize] ; } ; # [doc = "\n---\n\nGenerated by [rb-sys](https...
 97s   |                                                ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
220s 
220s error[E0412]: cannot find type `RArray` in this scope
220s  --> /tmp/tmp.SXMzVBjVR1/target/x86_64-unknown-linux-gnu/debug/build/rb-sys-6425e5deae7afbe9/out/bindings-0.9.102-x86_64-linux-gnu-3.1.2.rs:1:104102
220s   |
220s 1 | ...{ ["Size of RArray"] [:: std :: mem :: size_of :: < RArray > () - 40usize] ; ["Alignment of RArray"] [:: std :: mem :: align_of :: < R...
220s   |                                                        ^^^^^^ not found in this scope
220s error[E0412]: cannot find type `rb_sys__Opaque__RString` in this scope
220s  --> /tmp/tmp.SXMzVBjVR1/target/x86_64-unknown-linux-gnu/debug/build/rb-sys-6425e5deae7afbe9/out/bindings-0.9.102-x86_64-linux-gnu-3.1.2.rs:1:221019
220s   |
220s 1 | ..._RString"] [:: std :: mem :: align_of :: < rb_sys__Opaque__RString > () - 8usize] ; } ; # [allow (clippy :: unnecessary_operation , cl...
220s   |                                               ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

see e.g. https://ci.debian.net/data/autopkgtest/testing/amd64/r/rust-rb-sys/54516503/log.gz for a full log.

I believe the reason for these is starting from v0.70 layout tests were replaced with build-time compilation tests. rb-sys-build, however, still expects actual tests so it does not modify the generated bindings file properly for opaque types (there are no bindgen_test_* functions in the file generated by v0.70).

Edit: Maybe I should have been more clear in specifying that, since the error is a compile error, it's the whole feature that's broken (as in cargo build --feature bindgen-layout-tests), not just the tests (as in cargo test --feature bindgen-layout-tests). In Debian, that showed up as a test failure, but in general the feature fails to build too for the aforementioned reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant