[R-pkg-devel] different build tools

Boylan, Ross Ro@@@Boy|@n @end|ng |rom uc@|@edu
Wed May 29 00:20:44 CEST 2024


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.  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.

Thanks.
Ross

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list