[Rd] Windows check problems.

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Wed Dec 11 17:22:28 CET 2019


The thread starting with this message:

https://stat.ethz.ch/pipermail/r-package-devel/2019q4/004745.html

described problems Rich Heiberger was having with package checking on 
Windows.  It appeared that during the tests of examples, an old version 
of the package was loaded but the new tests were being run, causing lots 
of confusion and trouble.

I reproduced the error, and I think I've found the cause.  I had his 
package tarball on a network drive, with a local drive being used for 
the session temporary directory.  The check code needs a copy of the 
package installed in the temporary directory, and already has one in the 
pkg.Rcheck directory where the check is taking place, so it tries to 
create a junction linking them.  (On non-Windows systems it uses a symlink.)

Apparently the junction creation silently fails:  an empty directory 
appears on the temp dir.  When R loads the package code, it doesn't find 
it in the temp dir, and goes looking in other libraries, where it found 
an older versions of the package.

A workaround for this issue is to set the environment variable

   R_WIN_NO_JUNCTIONS=yes

before doing the check.  This causes the check code to copy all the 
files into the temp dir and things are fine.

I don't know whether the junction creation should have succeeded, or 
whether it should have signalled an error when it didn't, but it might 
make sense for R to do a simple sanity check after trying to create the 
junction (e.g. test for the presence of DESCRIPTION in the newly created 
location), falling back to a copy if things didn't succeed.

Duncan Murdoch



More information about the R-devel mailing list