Closed ngortheone closed 1 year ago
This also happens when I follow example from druid book https://linebender.org/druid/get_started.html
This seems to be caused by old version of piet-common
dependecny .. changing piet-common to latest master branch fixes this issue, but now I have new issue:
/opt/ngor/src/github.com/linebender/druid/druid-shell/wrapper.h:1:10: fatal error: 'xkbcommon/xkbcommon-compose.h' file not found
thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("/opt/ngor/src/github.com/linebender/druid/druid-shell/wrapper.h:1:10: fatal error: 'xkbcommon/xkbcommon-compose.h' file not found\n")', druid-shell/build.rs:53:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Seems that build.rs is broken - it can't find the header file (which is present in the system)
Maybe we should be using the clang_arg function to provide the include path to bindgen
. It looks like the include paths should be accessible to us from the calls to probe_library
...
@jneem yes, my current diff to build.rs:
--- a/druid-shell/build.rs
+++ b/druid-shell/build.rs
@@ -14,7 +14,7 @@ fn main() {
return;
}
- probe_library("xkbcommon").unwrap();
+ let xkbcommon = probe_library("xkbcommon").unwrap();
#[cfg(feature = "x11")]
probe_library("xkbcommon-x11").unwrap();
@@ -34,6 +34,12 @@ fn main() {
// The input header we would like to generate
// bindings for.
.header_contents("wrapper.h", &header)
+ .clang_args(
+ xkbcommon
+ .include_paths
+ .iter()
+ .map(|path| format!("-I{}", path.to_string_lossy())),
+ )
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
@@ -48,7 +54,7 @@ fn main() {
// we use FILE from libc
.blocklist_type("FILE")
.blocklist_type("va_list")
- .blocklist_type("_.*")
+ //.blocklist_type("_.*")
.generate()
.expect("Unable to generate bindings");
And with this patch is it now building on FreeBSD? It seems good to me except for the change to blocklist_type
, could you explain that part?
.blocklist_type("_.*")
was preventing some necessary symbols from being detected, and the build was failing.
Ok, I've committed those changes in #2295
Trying to build master branch on FreeBSD with this command
Gives the following error:
I am doing something wrong or is this a bug? Thanks