Skip to content

thread 'main' panicked at .... is not a valid Ident #2700

Closed
@aholtzma-am

Description

@aholtzma-am

The problem occurs on an otherwise working codebase when built on Sonoma 14.0. Looking at the very few times I can find this message coming up, it was related to the wrong libclang being used, but I don't have another other copies or clang or llvm.

How should I go about debugging this?

Input C/C++ Header

Failure is somewhere in MacOS system headers on Sonoma 14.0.

Bindgen Invocation

  let bindings = bindgen::Builder::default()
        // The input header we would like to generate
        // bindings for.
        .header("wrapper.h")
        .clang_arg("-I/opt/homebrew/include")
        .clang_arg("-L/opt/homebrew/lib")
        // Don't convert size_t to an int of the pointer size
        .size_t_is_usize(true)
        // Finish the builder and generate the bindings.
        .generate()
        // Unwrap the Result and panic on failure.
        .expect("Unable to generate bindings");

Actual Results

thread 'main' panicked at '"wait_struct_(unnamed_at_/Applications/Xcode_app/Contents/Developer/Platforms/MacOSX_platform/Developer/SDKs/MacOSX_sdk/usr/include/sys/wait_h_199_2)" is not a valid Ident', /Users/aholtzma/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.56.0/src/ir/context.rs:846:9
stack backtrace:
0: rust_begin_unwind
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
2: proc_macro2::fallback::validate_ident
3: proc_macro2::fallback::Ident::new_checked
4: proc_macro2::imp::Ident::new_checked
5: proc_macro2::Ident::new
6: bindgen::ir::context::BindgenContext::rust_ident_raw
7: bindgen::ir::context::BindgenContext::rust_ident
8: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
9: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
10: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
11: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
12: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
13: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
14: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
15: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
16: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
17: bindgen::codegen::codegen::{{closure}}
18: bindgen::ir::context::BindgenContext::gen
19: bindgen::codegen::codegen
20: bindgen::Bindings::generate
21: bindgen::Builder::generate
22: build_script_build::main
23: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Expected Results

The build to be successful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions