[R-pkg-devel] different build tools

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed May 29 01:12:08 CEST 2024


Duncan's point about options is key... the build options set by default in devtools etc are generally configured to minimize the time required to identify the next big issue to address. Options appropriate for preparing to submit to CRAN are slow and inconvenient for developing.

I recommend that you always use option 1 when preparing to share or submit your package.

Note that while using support tools like roxygen, devtools, and RStudio are common, they are intended to streamline the package development process by filling in a lot of busywork details. However, they do not represent the official R-supported development process, and may become out-of-date during R version transitions.

On May 28, 2024 3:29:41 PM PDT, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
>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
>
>______________________________________________
>R-package-devel using r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-package-devel mailing list