Cargo building system in complex projects

Hi guys, was wondering if everyone has worked/experience in large projects that involve complex building/testing/bench setups using plugin systems.
I am currently working on a project with the core built in Rust and a plugin system with dynamic libraries in C and Rust within a cargo workspace. I love cargo for it's simplicity but as of now i think it has reached it's limits.

For building the core and plugins I am running python script (which could be a batch script or makefile) that builds some plugins with make or cargo (whether is C or rust respectively) and finally copies the binary files to a building directory. To keep in mind that some plugins are not crates and are just C dynamic libraries, I think that compiling them might be possible by wrapping them around a crate and using build.rs to instruct the build (at the time I wrote the python building script i wasn't aware of this), but this seems unnecessarily complex compared to using a Makefile. To add to this, I am not yet doing cross compilation which will probably be requirement in the future.

Even some integration and end2end tests can be complex as some tests builds their own plugins, which are currently built within the test itself (by invoking make). Currently i am using cargo for tests too but I am afraid in the future the situation can become unmanageable.

Now I also have started doing some automated benchmarks, which will need to compile special plugins and do some math based on output files. Also "cargo bench" doesn't seem to be able to handle this, as I will need to build the core and some special plugins and do some calculations based on output files. If there was a feature to run a script after "cargo bench" I could just use cargo on top of make or any other script, but as of my knowledge this is not possible.

The obvious solution here is probably to start using make on top of cargo but this kind of defeats the norm in rust projects, whenever there is a rust project we expect it to build using "cargo build" and not "make" or "python build.py" for example.

So, I would like to hear opinions on similar experiences mainly with dependencies in multiple languages, which I think is the reason most of this problems arise.

Limit/divide is when you start adding bots. Any script/config exclusive-to-use are part of project-development and best separate from product (source code and tests.)

1 Like

That sounds promising, I was not aware of it.
Thanks I will have a look into it :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.