devtools::build() cannot stat directories that exist

428 views Asked by At

I'm using devtools to build a package that has packrat enabled. When I issue the command devtools::build() I get the following:

'/usr/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD build '/home/user/Development/CPAT' --no-resave-data --no-manual 

* checking for file ‘/home/user/Development/CPAT/DESCRIPTION’ ... OK
cp: cannot stat 'CPAT/packrat/lib-ext/i686-pc-linux-gnu/3.4.2/CPAT': No such file or directory
cp: cannot stat 'CPAT/packrat/lib-ext/i686-pc-linux-gnu/3.4.2/R6': No such file or directory
cp: cannot stat 'CPAT/packrat/lib-ext/i686-pc-linux-gnu/3.4.2/Rcpp': No such file or directory
cp: cannot stat 'CPAT/packrat/lib-ext/i686-pc-linux-gnu/3.4.2/RcppArmadillo': No such file or directory
...
 ERROR
copying to build directory failed
Error: Command failed (1)

I checked .Rbuildignore and the line ^packrat/ is there, so I would think that packrat would be ignored, but that doesn't appear to be the case.

I should also mention that the directories mentioned above reference files that are on a different computer than the one building the package; the platform is x86_64-pc-linux-gnu and the R version is 3.5.1. (When I use ls to list the above files I see that the files are symbolic links). Thus the R versions are not the same on both computers, but I've been using git to develop the package on both computers.

What should I do about this error?

1

There are 1 answers

0
Andrew Little On

Restarting the session (Ctrl + Shift + F10) seems to regularly fix this for me.