A unit test in my application exposes a bug in the C library it indirectly depends on, and I can't reproduce the bug without my application, so I need to edit the C code while running Rust app's tests.
I have:
A C library built with autotools » wrapped in rust-sys package (that clones the source from git to cargo's OUT_DIR
) » wrapped in higher-level Rust package » used by my application.
The usual way I use is to push code to git repository of the C code, and then bump version of all the packages along the way, but that's way to much to do for every single line tweaked.
Ideally I'd like to modify cloned copy of the C code that sits in my app's target
directory, but I don't know how to make Cargo notice it has changed and rebuild it (I can't delete whole target
dir, because that's where the cloned C code is).
I found I can delete target/debug/build/*/build-script-build
to make cargo say it's compiling it, but I don't think it really is. Cargo is a black box that hides all its build output, so I don't know if it's really rebuilding, or just relinking something cached.
How can I make Cargo completely rebuild (starting with re-running build.rs
) a dependency of my apps' dependency, but without deleting target/debug/build/*/out/
? (or maybe there's a better way to edit the C code quickly)