[Rd] Bug in R CMD INSTALL when handling invalid LazyData DESCRIPTION field

Aaron Wells aaronw at catalyst.net.nz
Fri Nov 24 00:46:48 CET 2017

Hi, I think I've found a bug in R CMD INSTALL. When it tries to parse a
DESCRIPTION file with an invalid LazyData field, it errors out while
trying to print the correct error message:

* installing to library ‘/home/example/R/x86_64-pc-linux-gnu-library/3.4’
* installing *source* package ‘samplepackage’ ...
** data
Error in errmsg("invalid value of ", field, " field in DESCRIPTION") :
  could not find function "errmsg"
* removing ‘/home/example/R/x86_64-pc-linux-gnu-library/3.4/samplepackage’

It should instead be using that errmsg() function to print the more
helpful error message: "invalid value of LazyData field in DESCRIPTION".

I've traced it down to this line of code in tools:::.install_packages()
. The errmsg() function actually is defined earlier on in the function,
but there seems to be a scoping issue that makes it not available here.

I've uploaded a sample project to reproduce the bug here:

I'm running R version 3.4.2 (2017-09-28), on Ubuntu 16.04.


More information about the R-devel mailing list