Skip to content

Panic with 'Unable to get layout information?' #1768

Open
@virtualritz

Description

@virtualritz

I'm trying to create a wrapper around OpenVDB C++ library. OpenVDB is a volume data file format used in blockbuster visual effects.

There is a repo with instructions to replicate on macOS. The panic happens pretty late during binding generation.

Bindgen Invocation

    let openvdb_bindings = bindgen::Builder::default()
        .header("wrapper.hpp")
        .clang_arg("-std=c++11")
        .clang_arg(format!("-I/{}", open_vdb.join("include").display()))
        .clang_arg("-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/")
        .clang_arg("-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/")
        .clang_arg("-I/Library/Developer/CommandLineTools/usr/include/c++/v1/")
        .clang_arg("-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/")
        .clang_arg("-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/")
        .generate()
        .expect("Unable to generate OpenVDB bindings.");

Actual Results

thread 'main' panicked at 'Unable to get layout information?', /Users/moritz/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.53.2/src/codegen/mod.rs:1682:26
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::option::expect_failed
   9: core::option::Option<T>::expect
  10: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
  11: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
  12: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
  13: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
  14: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
  15: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
  16: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
  17: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
  18: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
  19: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
  20: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
  21: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
  22: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
  23: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
  24: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
  25: bindgen::codegen::codegen::{{closure}}
  26: bindgen::ir::context::BindgenContext::gen
  27: bindgen::codegen::codegen
  28: bindgen::Bindings::generate
  29: bindgen::Builder::generate
  30: build_script_build::main
  31: std::rt::lang_start::{{closure}}
  32: std::rt::lang_start_internal
  33: std::rt::lang_start
  34: main

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions