-
Notifications
You must be signed in to change notification settings - Fork 785
Closed
Description
I'm attempting to create a minimal bindings.rs. I have a C header file that has many transitive includes, and I'd like to omit them all. I only want bindings that I have explicitly included.
In 0.61.0, this code worked fine:
let bindings = bindgen::Builder::default()
.header("src/cfuncs/myheader.h")
.blocklist_type("*") // block everything not explicitly added
.allowlist_function("rdb_.*")
.allowlist_var("RDB_.*")
.allowlist_type("rdb_.*")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings");
I upgraded to 0.64.0 and it ignored my blocklist. It started pulling in all of the transitive dependencies.
I added a few lines:
let bindings = bindgen::Builder::default()
.header("src/cfuncs/myheader.h")
.blocklist_type("*") // block everything not explicitly added
// these lines added
.blocklist_file("*")
.blocklist_function("*")
.blocklist_item("*")
.opaque_type("*")
.allowlist_function("rdb_.*")
.allowlist_var("RDB_.*")
.allowlist_type("rdb_.*")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings");
but this command still pulls in all of the transitives.
How do I get it to behave like 0.61.0?
Metadata
Metadata
Assignees
Labels
No labels