You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SentryPeer is being extended using Rust as a lib. This Rust lib also uses SentryPeer via a C lib it generates, hence the use of cbindgen and bindgen in the same build.rs. This is all driven by autotools.
// The bindgen::Builder is the main entry point// to bindgen, and lets you build up options for// the resulting bindings.let bindings = bindgen::Builder::default()// The input header we would like to generate// bindings for..header("wrapper.h")// Pick the functions we want to generate bindings for.allowlist_function("sentrypeer_config_new|sentrypeer_config_destroy").allowlist_function("sip_message_event_new|sip_message_event_destroy").allowlist_function("sip_log_event")// Tell cargo to invalidate the built crate whenever any of the// included header files changed..parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))// Finish the builder and generate the bindings..generate()// Unwrap the Result and panic on failure..expect("Unable to generate bindings");// Write the bindings to the $OUT_DIR/bindings.rs file.let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs")).expect("Couldn't write bindings.rs, so can't use SentryPeer C lib!");
What options do I have for setting where we look for files?
Output
--- stderr
src_dir: ../..
./../src/conf.h:21:10: fatal error: '../config.h' file not found
thread 'main' panicked at build.rs:60:10:
Unable to generate bindings: ClangDiagnostic("./../src/conf.h:21:10: fatal error: '../config.h' file not found\n")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
make[2]: *** [Makefile:2850: /home/ghenry/src/sentrypeer/sentrypeer-4.0.0/_build/sub/sentrypeer_rust/target/release/libsentrypeer_rust.a] Error 101
make[2]: Leaving directory '/home/ghenry/src/sentrypeer/sentrypeer-4.0.0/_build/sub'
make[1]: *** [Makefile:942: all] Error 2
make[1]: Leaving directory '/home/ghenry/src/sentrypeer/sentrypeer-4.0.0/_build/sub'
Intro
SentryPeer is being extended using Rust as a lib. This Rust lib also uses SentryPeer via a C lib it generates, hence the use of
cbindgen
andbindgen
in the samebuild.rs
. This is all driven by autotools.Input C/C++ Header
https://github.com/SentryPeer/SentryPeer/blob/main/sentrypeer_rust/wrapper.h
Bindgen Invocation
https://github.com/SentryPeer/SentryPeer/blob/main/sentrypeer_rust/build.rs
What options do I have for setting where we look for files?
Output
I'm passing in SRC_DIR from my makefile here:
https://github.com/SentryPeer/SentryPeer/blob/main/Makefile.am#L273
This is all to try and get
make distcheck
to work for VPATHMaybe I just can't.
make dist
and running all the usual works:Thanks.
The text was updated successfully, but these errors were encountered: