I have a Cargo workspace with several packages, including a bin project that creates three binaries: a main Rust application and two helper binaries implemented in c. The c binaries are built using a build.rs script.
The two helpers communicate with the main Rust application over stdio using serialized data structures. I wanted to be able to use Serde for the serialization in the c helper programs. So I created another package in the workspace that exposed a c abi and generated a .so library.
Overall here's what it looks like:
- Cargo Workspace
- exopticon package
- exopticon binary, main Rust application
- captureworker binary
- implemented in c
- built by build.rs
- depends on exserial.so
- playbackworker binary
- implemented in c
- built by build.rs
- depends on exserial.so
- exserial package
- generates libexserial.so
- exopticon package
It basically works now for dev builds but Cargo doesn't really understand the dependency and the paths are hardcoded so release builds and "cargo clippy" don't work. Here's a failing build log: app-build (#368920941) · Jobs · David Matthew Mattli / exopticon · GitLab
How can I depend on the .so library generated by the exserial package, in the exopticon package?
Or what's a better way to structure workspace?
Or maybe is there a way to tell Cargo about non-rust artifact dependencies?
You can view the repository here: David Matthew Mattli / exopticon · GitLab
Thanks !