Hello
My project uses a rust dependency which is based on C/C++ libraries.
The build.rs of this rust dependency compiles the C/C++ libraries and generates the rust bindings.
The compilation of this C/C++ is extremely time and resource consuming.
I would like to embed the pre-compiled libraries in my environment (in particular for continuous integration) to optimize/cache this step.
I was thinking about providing some metadatas in my Cargo configuration this way:
.cargo/config
[target.x86_64-unknown-linux-gnu.foo]
rustc-link-search = ["/xxx/yyy/zzz"]
rustc-link-lib = ["libfoo"]
Cargo.toml
[dependencies]
foo = { version = "x.x.x", rustc-link-lib = ["foo"] }
But I have a failure when I build my project:
No such file or directory (os error 2)
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
3 | include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
It makes sense because the build.rs script of foo dependency generates the rust bindings and with my new cargo config the build.rs script is skipped and so the bindings.rs is not generated.
What can I do or request to the dependency maintainers to be able to do that ?
Eric