As currently implemented, R CMD build copies everything in the package
directory to a working directory, then unlinks those in .Rbuildignore
(see this comment by Jim Hester from 2018).
https://github.com/r-lib/rcmdcheck/issues/90#issuecomment-435938362
If one accidentally happens :-( to create a directory with many
gigabytes of junk in it, say from reverse-dependency-checking a widely
used package, then the presence of that directory (even if
.Rbuildignore'd) will make R CMD build hang as it tries to copy the
contents of the directory ...
I realize it's considerably more complicated to skip .Rbuildignore'd
files in the process of copying (I don't see offhand how to do it
without some fairly fancy unix-`find`-like tool, as opposed to a
straight-up `file.copy(..., recursive = TRUE)`, but I wonder if there's
any appetite for changing this behaviour?
cheers
Ben Bolker
This was filed on the bug tracker some time ago here: https://bugs.r-project.org/show_bug.cgi?id=17549 but (at least at the time) it seemed there wasn't any appetite to implement this on the R side. For what it's worth, one way to handle this locally is to put your own version of 'cp' on the PATH, and have that ignore certain files / directories when copying files. This is what I've been using successfully for some time https://gist.github.com/kevinushey/2351194ba540627831fa2d58073c097a but I agree it would be nice to have this, or something similar, implemented in R itself. Best, Kevin On Mon, May 18, 2026 at 11:36?AM Ben Bolker <bbolker at gmail.com> wrote:> > As currently implemented, R CMD build copies everything in the package > directory to a working directory, then unlinks those in .Rbuildignore > (see this comment by Jim Hester from 2018). > > https://github.com/r-lib/rcmdcheck/issues/90#issuecomment-435938362 > > If one accidentally happens :-( to create a directory with many > gigabytes of junk in it, say from reverse-dependency-checking a widely > used package, then the presence of that directory (even if > .Rbuildignore'd) will make R CMD build hang as it tries to copy the > contents of the directory ... > > I realize it's considerably more complicated to skip .Rbuildignore'd > files in the process of copying (I don't see offhand how to do it > without some fairly fancy unix-`find`-like tool, as opposed to a > straight-up `file.copy(..., recursive = TRUE)`, but I wonder if there's > any appetite for changing this behaviour? > > cheers > Ben Bolker > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Hi Ben I think this was discussed recently on one of the lists (although that may be a figment of my imagination). Either way, for info, there is more related discussion over in https://bugs.r-project.org/show_bug.cgi?id=17549. Tim> On 18 May 2026, at 19:36, Ben Bolker <bbolker at gmail.com> wrote: > > ? As currently implemented, R CMD build copies everything in the package directory to a working directory, then unlinks those in .Rbuildignore (see this comment by Jim Hester from 2018). > > https://github.com/r-lib/rcmdcheck/issues/90#issuecomment-435938362 > > If one accidentally happens :-( to create a directory with many gigabytes of junk in it, say from reverse-dependency-checking a widely used package, then the presence of that directory (even if .Rbuildignore'd) will make R CMD build hang as it tries to copy the contents of the directory ... > > I realize it's considerably more complicated to skip .Rbuildignore'd files in the process of copying (I don't see offhand how to do it without some fairly fancy unix-`find`-like tool, as opposed to a straight-up `file.copy(..., recursive = TRUE)`, but I wonder if there's any appetite for changing this behaviour? > > cheers > Ben Bolker > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel[[alternative HTML version deleted]]