Closed Thell closed 2 years ago
We do track Cargo.toml
and *rs
files and rebuild every time they are modified (modification time of source > modification time of binary) https://github.com/extendr/rextendr/blob/68fc6154440a1dcfb3d88dafee7bcc6238626188/R/track_rust_source.R#L97-L125
There is pkgbuild::clean_dll
, also re-exported by {devtools}
. We could have something like
rextendr::clean <- function(path = ".") {
run_cargo_clean(path)
pkgbuild::clean_dll(path)
}
Perhaps, with an additional level of verbosity (if needed).
I think that'd be good. Its surely not something that's a big issue though as manually issuing cargo clean is easy enough.
If you feel like you are up to the task, I invite you to contribute this function to {rextendr}
. I can guide you through the review process.
Sure! Give me some time to familiarize myself with the code base and such along with using it a bit more and I'll submit a PR.
Sometimes, when weird and odd things start to happen during the development process you really want to restart with a clean slate. Most dev tools have a clean and rebuild and I noted that to do a 'cargo clean' when playing with rextender that I needed to dive into the project src/rust to manually issue it. Would it be useful to have a clean/rebuild? Even along the lines of rcpp's sourcing with
rebuild=T
could be enough for those clean slate moments.