[R] Bug in R 3.6.0?

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Tue Apr 30 16:54:10 CEST 2019


>>>>> Morgan Morgan 
>>>>>     on Mon, 29 Apr 2019 21:42:36 +0100 writes:

    > Hi,
    > I am using the R 3.6.0 on windows. The issue that I report below does not
    > exist with previous version of R.
    > In order to reproduce the error you must install a package of your choice
    > from source (tar.gz).

    > -Create a .Rprofile file with the following command in it : setwd("D:/")
    > -Close your R session and re-open it. Your working directory must be now set
    > to D:
    > -Install a package of your choice from source, example :
    > install.packages("data.table",type="source")

    > In my case the package fail to install and I get the following error
    > message:

    > ** R
    > ** inst
    > ** byte-compile and prepare package for lazy loading
    > Error in tools:::.read_description(file) :
    > file 'DESCRIPTION' does not exist
    > Calls: suppressPackageStartupMessages ... withCallingHandlers ->
    > .getRequiredPackages -> <Anonymous> -> <Anonymous>
    > Execution halted
    > ERROR: lazy loading failed for package 'data.table'
    > * removing 'C:/Users/Morgan/Documents/R/win-library/3.6/data.table'
    > * restoring previous
    > 'C:/Users/Morgan/Documents/R/win-library/3.6/data.table'
    > Warning in install.packages :
    > installation of package ‘data.table’ had non-zero exit status

    > Now remove the .Rprofile file, restart your R session and try to install th
e
    > package with the same command.
    > In that case everything should be installed just fine.

    > FYI the issue happens on macOS as well and I suspect it also does on all
    > linux systems.

    > My question: Is this expected or is it a bug?

It is a bug, thank you very much for reporting it.

I've been told privately by Ömer An (thank you!) who's been
affected as well, that this problem seems to affect others, and
that there's a thread about this over at the Rstudio support site

https://support.rstudio.com/hc/en-us/community/posts/200704708-Build-tool-does-not-recognize-DESCRIPTION-file

There, users mention that (all?) packages are affected which
have a multiline 'Description:' field in their DESCRIPTION file.
Of course, many if not most packages have this property.

Indeed, I can reproduce the problem (e.g. with my 'sfsmisc'
package) if I ("silly enough to") add a setwd() call to my
Rprofile file  (the one I set via env.var  R_PROFILE or R_PROFILE_USER). 

This is clearly a bug, and indeed a bad one.

It seems all R core (and other R expert users who have tried R
3.6.0 alpha, beta, and RC versions) have *not* seen the bug as they
are intuitively smart not to mess with R's working directory in
a global R profile file ...

For now you definitively have to work around by not doing what's
the problem : do *NOT* setwd() in your  ~/.Rprofile or other
such R init files.

Best,
Martin Maechler
ETH Zurich and  R Core Team



More information about the R-help mailing list