Skip to content

Add linux aarch64 target to ci test #3217

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NickeZ
Copy link
Contributor

@NickeZ NickeZ commented Jun 6, 2025

I guess it should be as simple as this now that aarch64 runners have been added.

@NickeZ NickeZ force-pushed the nickez/release-aarch64-linux branch 11 times, most recently from 5049277 to b2c3bb3 Compare June 6, 2025 11:10
@NickeZ
Copy link
Contributor Author

NickeZ commented Jun 6, 2025

Not sure what to do about the failure:


failures:

---- test_wrap_static_fns stdout ----
In path is ::: tests/expectations/tests/generated/wrap_static_fns
Out path is ::: /home/runner/work/rust-bindgen/rust-bindgen/target/debug/build/bindgen-tests-c763cee99ba75d0d/out/wrap_static_fns

thread 'test_wrap_static_fns' panicked at bindgen-tests/tests/tests.rs:742:10:
Failed to generate bindings: Codegen(Serialize { msg: "Cannot serialize type kind Opaque", loc: "tests/headers/wrap-static-fns.h:63:56" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_wrap_static_fns

@NickeZ NickeZ force-pushed the nickez/release-aarch64-linux branch 3 times, most recently from ac7e42b to ebb148b Compare June 7, 2025 08:47
@emilio
Copy link
Contributor

emilio commented Jun 8, 2025

This needs a rebase but I think the failure is legit. Is it crashing on the valist in that test?

If you can reproduce locally, it'd be great to see what bit of the test is failing.

@NickeZ NickeZ force-pushed the nickez/release-aarch64-linux branch from ebb148b to 330b518 Compare June 8, 2025 19:48
@NickeZ NickeZ changed the title Add linux aarch64 target to release Add linux aarch64 target to ci test Jun 8, 2025
@NickeZ
Copy link
Contributor Author

NickeZ commented Jun 8, 2025

I reproduced and got a stacktrace locally:

thread 'test_wrap_static_fns' panicked at bindgen-tests/tests/tests.rs:742:10:
Failed to generate bindings: Codegen(Serialize { msg: "Cannot serialize type kind Opaque", loc: "tests/headers/wrap-static-fns.h:63:56" })
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/std/src/panicking.rs:697:5
   1: core::panicking::panic_fmt
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/panicking.rs:75:14
   2: core::result::unwrap_failed
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/result.rs:1704:5
   3: core::result::Result<T,E>::expect
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/result.rs:1061:23
   4: tests::test_wrap_static_fns
             at ./tests/tests.rs:736:21
   5: tests::test_wrap_static_fns::{{closure}}
             at ./tests/tests.rs:724:26
   6: core::ops::function::FnOnce::call_once
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/17067e9ac6d7ecb70e50f92c1944e545188d2359/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test test_wrap_static_fns ... FAILED

How to reproduce, something like this:

docker run --platform linux/arm64 -ti rust:latest bash
apt update
apt install libclang1-19
git clone https://github.com/rust-lang/rust-bindgen
cd rust-bindgen
RUST_BACKTRACE=1 cargo test test_wrap_static_fns

@NickeZ
Copy link
Contributor Author

NickeZ commented Jun 9, 2025

I tried running it manually but it seems to succeed, @emilio how can I trigger the panic by running bindgen?

$ cargo run -- bindgen-tests/tests/headers/wrap-static-fns.h
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.54s
     Running `target/debug/bindgen bindgen-tests/tests/headers/wrap-static-fns.h`
Warning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.
/* automatically generated by rust-bindgen 0.72.0 */

pub type func = ::std::option::Option<
    unsafe extern "C" fn(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int,
>;
pub const foo_BAR: foo = 0;
pub type foo = ::std::os::raw::c_uint;

edit: Managed to reproduce

$ cargo run -- --wrap-static-fns bindgen-tests/tests/headers/wrap-static-fns.h
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/bindgen --wrap-static-fns bindgen-tests/tests/headers/wrap-static-fns.h`
Unable to generate bindings: codegen error: serialization error at bindgen-tests/tests/headers/wrap-static-fns.h:63:56: Cannot serialize type kind Opaque

edit2: Attached debug output
debug.log

edit3: I have never worked on bindgen, so I probably won't be able to figure out what could be wrong here.

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

Successfully merging this pull request may close these issues.

2 participants