[R-pkg-devel] different build tools

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Wed May 29 00:29:41 CEST 2024


On 2024-05-28 6:20 p.m., Boylan, Ross via R-package-devel wrote:
> There are at  least 4 ways to build a package:
> 
>    1.  R CMD build
>    2.  pkgbuild::build(), which I  believe calls 1.
>    3.  devtools::build(), which calls 2.
>    4.  RStudio GUI, which calls 3.
> 
> I recently discovered these don't all behave the same.  Invoking bootstrap.R at  the start
> requires 2 or greater. 

What is bootstrap.R?

  And invoking 3 directly produced different behavior than 4,
> apparently because of  different defaults for the clean_doc option of 2.
> 
> Similar remarks apply to R CMD check.
> 
> I'm puzzled by the plethora of tools and options.  In particular I had assumed that if check
> and build worked in RStudio, I'd get the same results from R CMD.  I assume the latter is
> used on CRAN, and so it would be reasonable to expect the package would build there.
> 
> Can anyone help me understand what's going on?  More specifically, what are the design
> goals of the different tools.  Clearly if devtools::build were the same as pkgbuild:build there
> would be no reason for the former to exist.
> 

pkgbuild, devtools and RStudio are all products of Posit, so it would 
make sense to ask your question in one of their forums.

By the way, RStudio has project and global options that affect its 
builds; the default uses devtools, but I generally deselect that, and go 
straight to 1.

Duncan Murdoch



More information about the R-package-devel mailing list