rust-bindgen
rust-bindgen copied to clipboard
passing -print-search-dirs causes panic with no helpful message
I was trying to follow from where bindgen was pulling headers. I was suggested to pass the -print-search-dirs
clang flag.
Unfortunately, this simply caused bindgen to panic, with a very generic error message. The backtrace also did not yield anything useful. This was on a Windows 10 system with LLVM 11 installed, and bindgen 0.56.0.
Bindgen Invocation
$ bindgen wrapper.h -- -print-search-dirs
Actual Results
Apologies for the screenshots, cannot copy-paste from a VM.
Backtrace on Linux, where the same thing happens:
0: rust_begin_unwind
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
1: core::panicking::panic_fmt
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
2: core::option::expect_failed
at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/option.rs:1226
3: bindgen::ir::context::BindgenContext::new
4: bindgen::Builder::generate
5: std::panicking::try
6: bindgen::main
This is still an issue, in the meantime, you can use ParseCallbacks::include_file
to check which files are included.