rust-lang / rust-lang/rust-bindgen

"fatal error: 'string' file not found" on macOS

Open
#1,834 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

Input C/C++ Header
#include <string>
Bindgen Invocation
bindgen::Builder::default()
	.header("wrapper.hpp")
	.detect_include_paths(false)
	.clang_arg("-std=c++14")
	.generate()
	.expect("Couldn't make bindings!");
Actual Results
The following warnings were emitted during compilation:

warning: couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
warning: set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)

error: failed to run custom build command for `bindgen-hates-macos v0.1.0 (/Users/LoganDark/CLionProjects/bindgen-hates-macos)`

Caused by:
  process didn't exit successfully: `/Users/LoganDark/CLionProjects/bindgen-hates-macos/target/debug/build/bindgen-hates-macos-e6fb019ae718a79e/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=wrapper.hpp
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)

--- stderr
[2020-07-22T05:47:08Z DEBUG bindgen] Generating bindings, libclang at /usr/local/opt/llvm@10/lib/libclang.dylib
[2020-07-22T05:47:08Z DEBUG bindgen] Fixed-up options: BindgenOptions { blacklisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_items: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, opaque_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustfmt_path: None, whitelisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_vars: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_enum_style: Consts, bitfield_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, newtype_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_non_exhaustive_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enum_modules: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_alias_style: TypeAlias, type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias_deref: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, builtins: false, emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, enable_function_attribute_detection: false, disable_name_namespacing: false, disable_nested_struct_naming: false, disable_header_comment: false, layout_tests: true, impl_debug: false, impl_partialeq: false, derive_copy: true, derive_debug: true, derive_default: false, derive_hash: false, derive_partialord: false, derive_ord: false, derive_partialeq: false, derive_eq: false, use_core: false, ctypes_prefix: None, time_phases: false, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], module_lines: {}, clang_args: ["-std=c++14", "wrapper.hpp"], input_header: Some("wrapper.hpp"), input_unsaved_files: [], parse_callbacks: Some(CargoCallbacks), codegen_config: FUNCTIONS | TYPES | VARS | METHODS | CONSTRUCTORS | DESTRUCTORS, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, generate_block: false, block_extern_crate: false, enable_mangling: true, detect_include_paths: false, prepend_enum_name: true, rust_target: Stable_1_40, rust_features: RustFeatures { untagged_union: true, associated_const: true, builtin_clone_impls: true, repr_align: true, i128_and_u128: true, must_use_function: true, repr_transparent: true, min_const_fn: true, core_ffi_c_void: true, repr_packed_n: true, maybe_uninit: true, non_exhaustive: true, thiscall_abi: false }, record_matches: true, size_t_is_usize: false, rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_copy_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_hash_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, array_pointers_in_arguments: false, wasm_import_module_name: None }
wrapper.hpp:1:10: fatal error: 'string' file not found
wrapper.hpp:1:10: fatal error: 'string' file not found, err: true
thread 'main' panicked at 'Couldn't make bindings!: ()', build.rs:9:20
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::result::unwrap_failed
   9: core::result::Result<T,E>::expect
  10: build_script_build::main
  11: std::rt::lang_start::{{closure}}
  12: std::rt::lang_start_internal
  13: std::rt::lang_start
  14: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Expected Results

I expected no fatal error.


This has happened on every single clang on my macOS 10.14.6 system, even if I try to specify include paths and stuff. Also it's really weird. Look here:

0 LoganDark ~/CLionProjects/bindgen-hates-macos
env LLVM_CONFIG_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/llvm-config LIBCLANG_PATH=/usr/local/Cellar/llvm/10.0.0_3/lib/ CLANG_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/clang++ BINDGEN_EXTRA_CLANG_ARGS=(wx-config --cxxflags)' -I/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks' RUST_LOG=bindgen RUST_BACKTRACE=1 bindgen --no-include-path-detection wrapper.hpp
[2020-07-22T05:53:18Z INFO  bindgen] Clang Version: clang version 10.0.0 , parsed: Some((10, 0))
[2020-07-22T05:53:18Z DEBUG bindgen] Generating bindings, libclang at /usr/local/Cellar/llvm/10.0.0_3/lib/libclang.dylib
[2020-07-22T05:53:18Z DEBUG bindgen] Fixed-up options: BindgenOptions { blacklisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_items: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, opaque_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustfmt_path: None, whitelisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_vars: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_enum_style: Consts, bitfield_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, newtype_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_non_exhaustive_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enum_modules: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_alias_style: TypeAlias, type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias_deref: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, builtins: false, emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, enable_function_attribute_detection: false, disable_name_namespacing: false, disable_nested_struct_naming: false, disable_header_comment: false, layout_tests: true, impl_debug: false, impl_partialeq: false, derive_copy: true, derive_debug: true, derive_default: false, derive_hash: false, derive_partialord: false, derive_ord: false, derive_partialeq: false, derive_eq: false, use_core: false, ctypes_prefix: None, time_phases: false, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], module_lines: {}, clang_args: ["-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1", "-I/usr/local/include/wx-3.1", "-DWXUSINGDLL", "-D__WXOSX_COCOA__", "-D__WXMAC__", "-D__WXOSX__", "-pthread", "-I/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include", "-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include", "-F/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks", "wrapper.hpp"], input_header: Some("wrapper.hpp"), input_unsaved_files: [], parse_callbacks: None, codegen_config: FUNCTIONS | TYPES | VARS | METHODS | CONSTRUCTORS | DESTRUCTORS, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, generate_block: false, block_extern_crate: false, enable_mangling: true, detect_include_paths: false, prepend_enum_name: true, rust_target: Stable_1_40, rust_features: RustFeatures { untagged_union: true, associated_const: true, builtin_clone_impls: true, repr_align: true, i128_and_u128: true, must_use_function: true, repr_transparent: true, min_const_fn: true, core_ffi_c_void: true, repr_packed_n: true, maybe_uninit: true, non_exhaustive: true, thiscall_abi: false }, record_matches: true, size_t_is_usize: false, rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_copy_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_hash_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, array_pointers_in_arguments: false, wasm_import_module_name: None }
wrapper.hpp:1:10: fatal error: 'string' file not found
wrapper.hpp:1:10: fatal error: 'string' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /Users/LoganDark/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.1/src/main.rs:56:17
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_none_failed
   9: bindgen::main
  10: std::rt::lang_start::{{closure}}
  11: std::rt::lang_start_internal
  12: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Maybe the compiler's wrong? Nope.

1 LoganDark ~/CLionProjects/bindgen-hates-macos
/usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks wrapper.hpp
0 LoganDark ~/CLionProjects/bindgen-hates-macos ls
Cargo.lock      Cargo.toml      build.rs        src             target          wrapper.hpp     wrapper.hpp.gch

Let's try letting bindgen find the default Apple compiler:

1 LoganDark ~/CLionProjects/bindgen-hates-macos env RUST_LOG=bindgen RUST_BACKTRACE=1 bindgen wrapper.hpp
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)
[2020-07-22T05:55:07Z INFO  bindgen] Clang Version: clang version 10.0.0 , parsed: Some((10, 0))
[2020-07-22T05:55:07Z DEBUG bindgen] Generating bindings, libclang at /usr/local/opt/llvm@10/lib/libclang.dylib
[2020-07-22T05:55:07Z DEBUG bindgen] Trying to find clang with flags: []
[2020-07-22T05:55:07Z DEBUG bindgen] Found clang: Clang { path: "/usr/bin/clang", version: Some(CXVersion { Major: 10, Minor: 0, Subminor: 1 }), c_search_paths: Some(["/usr/local/include", "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include", "/Library/Developer/CommandLineTools/usr/include", "/usr/include", "/System/Library/Frameworks", "/Library/Frameworks"]), cpp_search_paths: Some(["/Library/Developer/CommandLineTools/usr/include/c++/v1", "/usr/local/include", "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include", "/Library/Developer/CommandLineTools/usr/include", "/usr/include", "/System/Library/Frameworks", "/Library/Frameworks"]) }
[2020-07-22T05:55:07Z DEBUG bindgen] Fixed-up options: BindgenOptions { blacklisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_items: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, opaque_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustfmt_path: None, whitelisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_vars: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_enum_style: Consts, bitfield_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, newtype_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_non_exhaustive_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enum_modules: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_alias_style: TypeAlias, type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias_deref: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, builtins: false, emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, enable_function_attribute_detection: false, disable_name_namespacing: false, disable_nested_struct_naming: false, disable_header_comment: false, layout_tests: true, impl_debug: false, impl_partialeq: false, derive_copy: true, derive_debug: true, derive_default: false, derive_hash: false, derive_partialord: false, derive_ord: false, derive_partialeq: false, derive_eq: false, use_core: false, ctypes_prefix: None, time_phases: false, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], module_lines: {}, clang_args: ["-isystem", "/usr/local/include", "-isystem", "/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include", "-isystem", "/Library/Developer/CommandLineTools/usr/include", "-isystem", "/usr/include", "-isystem", "/System/Library/Frameworks", "-isystem", "/Library/Frameworks", "wrapper.hpp"], input_header: Some("wrapper.hpp"), input_unsaved_files: [], parse_callbacks: None, codegen_config: FUNCTIONS | TYPES | VARS | METHODS | CONSTRUCTORS | DESTRUCTORS, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, generate_block: false, block_extern_crate: false, enable_mangling: true, detect_include_paths: true, prepend_enum_name: true, rust_target: Stable_1_40, rust_features: RustFeatures { untagged_union: true, associated_const: true, builtin_clone_impls: true, repr_align: true, i128_and_u128: true, must_use_function: true, repr_transparent: true, min_const_fn: true, core_ffi_c_void: true, repr_packed_n: true, maybe_uninit: true, non_exhaustive: true, thiscall_abi: false }, record_matches: true, size_t_is_usize: false, rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_copy_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_hash_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, array_pointers_in_arguments: false, wasm_import_module_name: None }
wrapper.hpp:1:10: fatal error: 'string' file not found
wrapper.hpp:1:10: fatal error: 'string' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /Users/LoganDark/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.1/src/main.rs:56:17
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_none_failed
   9: bindgen::main
  10: std::rt::lang_start::{{closure}}
  11: std::rt::lang_start_internal
  12: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Nope. Surely it must not work right?

0 LoganDark ~/CLionProjects/bindgen-hates-macos rm wrapper.hpp.gch
0 LoganDark ~/CLionProjects/bindgen-hates-macos ls
Cargo.lock  Cargo.toml  build.rs    src         target      wrapper.hpp
0 LoganDark ~/CLionProjects/bindgen-hates-macos clang wrapper.hpp
0 LoganDark ~/CLionProjects/bindgen-hates-macos ls
Cargo.lock      Cargo.toml      build.rs        src             target          wrapper.hpp     wrapper.hpp.gch

It does. However, with all the extra flags added by bindgen it doesn't:

1 LoganDark ~/CLionProjects/bindgen-hates-macos
clang -isystem /usr/local/include -isystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include -isystem /Library/Developer/CommandLineTools/usr/include -isystem /usr/include -isystem /System/Library/Frameworks -isystem /Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:1:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string:500:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string_view:176:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__string:56:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:640:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/initializer_list:47:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.

So telling bindgen not to add those flags should work then, right?

0 LoganDark ~/CLionProjects/bindgen-hates-macos
env RUST_LOG=bindgen RUST_BACKTRACE=1 bindgen --no-include-path-detection wrapper.hpp
cargo:warning=couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2))
cargo:warning=set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)
[2020-07-22T05:58:27Z INFO  bindgen] Clang Version: clang version 10.0.0 , parsed: Some((10, 0))
[2020-07-22T05:58:27Z DEBUG bindgen] Generating bindings, libclang at /usr/local/opt/llvm@10/lib/libclang.dylib
[2020-07-22T05:58:27Z DEBUG bindgen] Fixed-up options: BindgenOptions { blacklisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_items: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, opaque_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustfmt_path: None, whitelisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_vars: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_enum_style: Consts, bitfield_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, newtype_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_non_exhaustive_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enum_modules: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_alias_style: TypeAlias, type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias_deref: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, builtins: false, emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, enable_function_attribute_detection: false, disable_name_namespacing: false, disable_nested_struct_naming: false, disable_header_comment: false, layout_tests: true, impl_debug: false, impl_partialeq: false, derive_copy: true, derive_debug: true, derive_default: false, derive_hash: false, derive_partialord: false, derive_ord: false, derive_partialeq: false, derive_eq: false, use_core: false, ctypes_prefix: None, time_phases: false, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], module_lines: {}, clang_args: ["wrapper.hpp"], input_header: Some("wrapper.hpp"), input_unsaved_files: [], parse_callbacks: None, codegen_config: FUNCTIONS | TYPES | VARS | METHODS | CONSTRUCTORS | DESTRUCTORS, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, generate_block: false, block_extern_crate: false, enable_mangling: true, detect_include_paths: false, prepend_enum_name: true, rust_target: Stable_1_40, rust_features: RustFeatures { untagged_union: true, associated_const: true, builtin_clone_impls: true, repr_align: true, i128_and_u128: true, must_use_function: true, repr_transparent: true, min_const_fn: true, core_ffi_c_void: true, repr_packed_n: true, maybe_uninit: true, non_exhaustive: true, thiscall_abi: false }, record_matches: true, size_t_is_usize: false, rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_copy_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_hash_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, array_pointers_in_arguments: false, wasm_import_module_name: None }
wrapper.hpp:1:10: fatal error: 'string' file not found
wrapper.hpp:1:10: fatal error: 'string' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /Users/LoganDark/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.1/src/main.rs:56:17
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_none_failed
   9: bindgen::main
  10: std::rt::lang_start::{{closure}}
  11: std::rt::lang_start_internal
  12: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Nope...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with wrapper.hpp and the build.rs bindgen invocation, then compare the logged clang arguments and environment paths. Confirm the fix by generating bindings for the header on macOS without the fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos, rust
Domain
compilers, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.