duckdb/duckdb-rs

`bindgen` CI failing on Windows

Mytherin opened this issue · 0 comments

The bindgen CI is failing on Windows with the latest v1.0.0 build. I've disabled the CI run for now, but this should be looked into as this could indicate problems for the Windows release. Here is an example failing CI run

failures:

---- bindings::bindgen_test_layout__opaque_pthread_cond_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_cond_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:10334:
assertion `left == right` failed: Size of: _opaque_pthread_cond_t
  left: 44
 right: 48
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_cond_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_cond_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_cond_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_attr_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_attr_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:9218:
assertion `left == right` failed: Size of: _opaque_pthread_attr_t
  left: 60
 right: 64
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_attr_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_attr_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_attr_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_condattr_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_condattr_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:11461:
assertion `left == right` failed: Size of: _opaque_pthread_condattr_t
  left: 12
 right: 16
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_condattr_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_condattr_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_condattr_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_mutex_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_mutex_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:12604:
assertion `left == right` failed: Size of: _opaque_pthread_mutex_t
  left: 60
 right: 64
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutex_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutex_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutex_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_mutexattr_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_mutexattr_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:13740:
assertion `left == right` failed: Size of: _opaque_pthread_mutexattr_t
  left: 12
 right: 16
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutexattr_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutexattr_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_mutexattr_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_once_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_once_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:14885:
assertion `left == right` failed: Size of: _opaque_pthread_once_t
  left: 12
 right: 16
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_once_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_once_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_once_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_rwlock_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_rwlock_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:16008:
assertion `left == right` failed: Size of: _opaque_pthread_rwlock_t
  left: 196
 right: 200
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlock_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlock_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlock_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- bindings::bindgen_test_layout__opaque_pthread_rwlockattr_t stdout ----
thread 'bindings::bindgen_test_layout__opaque_pthread_rwlockattr_t' panicked at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out/bindgen.rs:3:17155:
assertion `left == right` failed: Size of: _opaque_pthread_rwlockattr_t
  left: 20
 right: 24
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:404
   3: core::panicking::assert_failed<usize,usize>
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panicking.rs:364
   4: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlockattr_t
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   5: libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlockattr_t::closure$0
             at D:\a\duckdb-rs\duckdb-rs\target\debug\build\libduckdb-sys-4f2c08f545dec78a\out\bindgen.rs:3
   6: core::ops::function::FnOnce::call_once<libduckdb_sys::bindings::bindgen_test_layout__opaque_pthread_rwlockattr_t::closure_env$0,tuple$<> >
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Pre-v1.0.0 these bindgen tests did not exist as can be seen in this CI run. For some reason bindgen has added extra tests after the port to v1.0.0, that then failed. Perhaps there is some configuration that can be set to disable this behavior. bindgen itself seems to have lacking support for Windows so this may well be an upstream bug that we are running into that we were not running into before due to some change in our C API between the two versions.

We could also consider whether we should be using bindgen anyway - given that our C API is not particularly complex. For the Julia client, for example, we don't use a library and generate the bindings ourselves.