From murdoch@dunc@n @end|ng |rom gm@||@com  Wed Dec 11 17:22:28 2019
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Wed, 11 Dec 2019 11:22:28 -0500
Subject: [Rd] Windows check problems.
Message-ID: <72f873b4-0d5c-18ef-1c9b-3495b1d37d81@gmail.com>

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



[Rd] Windows check problems.
Duncan Murdoch