Ross, R CMD build is the only offical way to build a (source) package in R.
All other "tools" are just convenience wrappers by 3rd parties that call R CMD build eventually. There is no reason to assume that those tools should behave in a certain way - nor are you required to use them. They typically do other pre-processing which their authors deemed useful (typically based on yet another packages). Finally, RStudio is a 3rd party GUI by the company Posit Software, PBC which changes/augments the behaviour of R and provides additional tools - it is not R nor directly related to R (nor CRAN). The packages you mentioned are also maintained by Posit. Please note that CRAN has nothing to do with any of the above - a package submitted to CRAN is the resulting package source tar ball which the author created by calling R CMD build - CRAN is not involved in the source package creation, it only requires it to be created with R CMD build for submission. Whether you desire some pre-processing, before you call R CMD build yourself, it's up to you. Cheers, Simon > On 29/05/2024, at 10:20 AM, Boylan, Ross via R-package-devel > <r-package-devel@r-project.org> 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. 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]] > > ______________________________________________ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel