r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
66 stars 35 forks source link

Run bootstrap.R file on build if present and specified in Config/build #157

Closed paleolimbot closed 1 year ago

paleolimbot commented 1 year ago

For https://github.com/r-lib/pkgdepends/issues/303 . Basically, I'm spending a lot of time working in repositories that share sources between Python and R packages and it would be nice if the pak-based tooling worked out-of-the box for things like Remotes: dependencies and check/build/install actions.

The general approach is:

The DESCRIPTION Config option is nice because it makes the opt-in more explicit (in the event that bootstrap.R existed in the package directory already) and because there was already a place to document Config/build options.

As @gaborcsardi pointed out, using Rscript + "boostrap.R" is more portable than a shell script because Rtools might not be installed or on the PATH.

This approach doesn't help with R CMD INSTALL pkg_directory but package authors can always do $R_HOME/bin/Rscript bootstrap.R in configure and/or configure.win, which also would work with devtools::load_all() (I think).

krlmlr commented 1 year ago

Should this be included in the dev version of pak already?

gaborcsardi commented 1 year ago

I am not sure what you mean by "should", but it will be (is?) only included if pak depends on dev pkgbuild.