-
Notifications
You must be signed in to change notification settings - Fork 706
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
thread 'main' panicked at '"__mbstate_t_(anonymous_struct_at_foo_cc_2_3)" is not a valid Ident' #2312
thread 'main' panicked at '"__mbstate_t_(anonymous_struct_at_foo_cc_2_3)" is not a valid Ident' #2312
Comments
This is due to this behavior change here, which changes the behavior of libclang: llvm/llvm-project@19e984e#diff-cde6fae42b53073a85e0901697f60ea80262705f86643b7b27524c7bd24c6f80 It seems they changed an API that was returning an empty string to return a formatted thing that we can't really easily parse or identify as an anonymous struct. @glandium I think this is worth an upstream bug report, could you do that if you have a build locally? Or do you want me to? |
Better if you do because I don't really know what bindgen would rather have available. |
Tests seem to pass, but they also pass with current master... However, for the testcase, with e69e0df + clang-trunk:
With e69e0df + clang 14:
|
scrap that, I didn't run them correctly. They do fail with master and fail less with your patches, but there are still 39 failing (vs. 87 without the patches), with errors that align with the previous comment. |
In trunk, Clang started emitting names like `"(unnamed enum at foo.cpp:4:2)"` for unnamed enums, structs, and unions, while previous versions emitted the empty string. This caused panics. This commit simply rewrites such names back to the empty string so that we stay compatible with both old and new versions of Clang. Closes rust-lang#2312.
#2316 is a fix. |
…y names. In Clang 16, anonymous items may return names like `(anonymous union at ..)` rather than empty names. The right way to detect them is using clang_Cursor_isAnonymous. Fixes rust-lang#2312 Closes rust-lang#2316 Co-Authored-by: Patrick Walton <[email protected]>
…y names. In Clang 16, anonymous items may return names like `(anonymous union at ..)` rather than empty names. The right way to detect them is using clang_Cursor_isAnonymous. Fixes rust-lang#2312 Closes rust-lang#2316 Co-Authored-by: Patrick Walton <[email protected]>
…y names. In Clang 16, anonymous items may return names like `(anonymous union at ..)` rather than empty names. The right way to detect them is using clang_Cursor_isAnonymous. Fixes #2312 Closes #2316 Co-Authored-by: Patrick Walton <[email protected]>
…y names. In Clang 16, anonymous items may return names like `(anonymous union at ..)` rather than empty names. The right way to detect them is using clang_Cursor_isAnonymous. Fixes rust-lang#2312 Closes rust-lang#2316 Co-Authored-by: Patrick Walton <[email protected]>
…y names. In Clang 16, anonymous items may return names like `(anonymous union at ..)` rather than empty names. The right way to detect them is using clang_Cursor_isAnonymous. Fixes rust-lang#2312 Closes rust-lang#2316 Co-Authored-by: Patrick Walton <[email protected]>
It looks like #2316 was canceled but #2319 resolved it instead? I am wondering why I am still hitting this issue on 0.61.0
|
Oops, I misread the release log, looks like there actually hasn't been one since the patch. Please ignore me, hopefully the next release isn't too far |
Unable to compile with Guile 3.x due to a clang update, which caused bindgen to break: rust-lang/rust-bindgen#2312 This also updates the bindings to GNU Guile 3.0.9.
Unfortunately, Debian 11 has just too old Rust which prevents us from working on anything not prehistoric. There are couple of issues: 1) It doesn't understand modern Cargo.toml syntax, which causes CI failures: https://gitlab.com/libvirt/libvirt-rust/-/merge_requests/64 2) We currently require bindgen-0.59.2 which doesn't work with LLVM-16 because of: rust-lang/rust-bindgen#2312 The fix is contained in bindgen-0.62.0. While there is some intersect between versions available to Debian 11 version of Rust (0.65.1, 0.64.0, 0.63.0, 0.62.0) neither of them generate code that Debian 11 version of Rust (1.48.0) understands. The bindgen-0.62.0 release notes set the minimal required version of rust to 1.57.0 anyway: https://crates.io/crates/bindgen/0.62.0 We are stuck. And the only way out is just to drop Debian 11 support. Live long my old friend. Signed-off-by: Michal Privoznik <[email protected]>
Unable to compile with Guile 3.x due to a clang update, which caused bindgen to break: rust-lang/rust-bindgen#2312 This also updates the bindings to GNU Guile 3.0.9.
As LLVM-16 is getting more and more popular, we are hitting the following bug when trying to regenerate bindings from libvirt header files: rust-lang/rust-bindgen#2312 Long story short, bindgen is not happy with some value that LLVM-16 returns (LLVM-15 is okay) and panics. While it's sufficient to bump bindgen to 0.62.0 we can go all the way to 0.69.2 which is supposed to work even with LLVM-18: https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md#0692-2024-01-13 Signed-off-by: Michal Privoznik <[email protected]>
This updates `bindgen` to 0.64, fixing rust-lang/rust-bindgen#2312 (via [`libpg_query-sys`](https://crates.io/crates/libpg_query-sys/0.2.1)) when building from source.
Bump bindgen to support newer clang versions. See rust-lang/rust-bindgen#2312 Also adapt the types referring to a size to usize, otherwise the new bindgen will no longer accept it. Signed-off-by: Florian Kauer <[email protected]>
Fixes #315 Build of sonic-server is failing on NixOS for a few weeks now, see https://hydra.nixos.org/build/239524816 This failing build has been caused by a clang 16 upgrade, because rocksdb depends on a old rust-bindgen version which is not compatible with this version of clang. See rust-lang/rust-bindgen#2312 A resolution is to upgrade rocksdb to its latest version.
Unable to compile with Guile 3.x due to a clang update, which caused bindgen to break: rust-lang/rust-bindgen#2312 This also updates the bindings to GNU Guile 3.0.9.
* Update bindgen Unable to compile with Guile 3.x due to a clang update, which caused bindgen to break: rust-lang/rust-bindgen#2312 This also updates the bindings to GNU Guile 3.0.9. * Update rust edition Use the most recent rust edition (2021) so that any future code is conformant. * Fix clippy lint issues Fix a trivial issue discovered by `cargo clippy'.
…package postgresql14Packages.promscale_extension breaks with: Error: 0: `pgx-0.6.1` shouldn't be used with `cargo-pgx-0.7.4`, please use `pgx = "~0.7.4"` in your `Cargo.toml`. However, pinning cargo-pgx to 0_6_1 via the following buildPgxExtension.override { cargo-pgx = cargo-pgx_0_6_1; } does not work either, because the build then fails with: thread 'main' panicked at /build/promscale_extension-0.8.0-vendor.tar.gz/proc-macro2/src/fallback.rs:756:9: "__mbstate_t_union_(unnamed_at_/nix/store/ij144ma6vs8acil8r9hgr8xkb1dp9azg-glibc-2_39-5-dev/include/bits/types/__mbstate_t_h_16_3)" is not a valid Ident This seems to be related to [1], which indicates that this is a problem with newer LLVM / clang toolchains. At the same time th upstream package is deprecated / archived since the 2nd of April 2024 [2]. Additionally this package is unfree and thus very unlikely to be forked. Since we can't expect this to be fixed, the only sensible thing to do is to remove the package. [1]: rust-lang/rust-bindgen#2312 [2]: timescale/promscale#1836
Bump bindgen to support newer clang versions. See rust-lang/rust-bindgen#2312 Also adapt the types referring to a size to usize, otherwise the new bindgen will no longer accept it. Signed-off-by: Florian Kauer <[email protected]>
Use sysrepo-rs version with newer bindgen version to support newer clang versions. See rust-lang/rust-bindgen#2312 Signed-off-by: Florian Kauer <[email protected]>
Use sysrepo-rs version with newer bindgen version to support newer clang versions. See rust-lang/rust-bindgen#2312 Signed-off-by: Florian Kauer <[email protected]> Reviewed-by: Kurt Kanzenbach <[email protected]>
Updates bindgen to fix rust-lang/rust-bindgen#2312
This started happening on clang-trunk with llvm/llvm-project@19e984e
Input C/C++ Header
Bindgen Invocation
Actual Results
The text was updated successfully, but these errors were encountered: