From dtenenba at fhcrc.org  Fri Oct 11 01:28:08 2013
From: dtenenba at fhcrc.org (Dan Tenenbaum)
Date: Thu, 10 Oct 2013 16:28:08 -0700 (PDT)
Subject: [Rd] install.packages() removes package on Windows
In-Reply-To: <433997010.1272981.1381443245564.JavaMail.root@fhcrc.org>
Message-ID: <702440245.1273820.1381447687920.JavaMail.root@fhcrc.org>

Hi,

Starting with the XML package installed:

> "XML" %in% rownames(installed.packages())
[1] TRUE
>

I ran the following script:

pkgs <- c("XML")

for (i in 1:100)
{
    install.packages(pkgs, repos="http://cran.fhcrc.org")
    if (!all(pkgs %in% rownames(installed.packages())))
    {
        print("failed to install pkgs!")
        print(paste("Iteration", i))
        break
    }
}

And it failed on the third iteration:

trying URL 'http://cran.fhcrc.org/bin/windows/contrib/3.0/XML_3.98-1.1.zip'
Content type 'application/zip' length 4287270 bytes (4.1 Mb)
opened URL
downloaded 4.1 Mb

package 'XML' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\biocbuild\AppData\Local\Temp\3\Rtmps7OWh0\downloaded_packages
trying URL 'http://cran.fhcrc.org/bin/windows/contrib/3.0/XML_3.98-1.1.zip'
Content type 'application/zip' length 4287270 bytes (4.1 Mb)
opened URL
downloaded 4.1 Mb

package 'XML' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\biocbuild\AppData\Local\Temp\3\Rtmps7OWh0\downloaded_packages
trying URL 'http://cran.fhcrc.org/bin/windows/contrib/3.0/XML_3.98-1.1.zip'
Content type 'application/zip' length 4287270 bytes (4.1 Mb)
opened URL
downloaded 4.1 Mb

package 'XML' successfully unpacked and MD5 sums checked
Warning: cannot remove prior installation of package 'XML'

The downloaded binary packages are in
        C:\Users\biocbuild\AppData\Local\Temp\3\Rtmps7OWh0\downloaded_packages
[1] "failed to install pkgs!"
[1] "Iteration 3"

At this point the XML package is not installed:

> "XML" %in% rownames(installed.packages())
[1] FALSE

Any idea what could cause this? There is no virus scanner running. 

I notice the warning about failing to remove prior installation, but it looks like it removed enough of it so that XML is no longer installed.

I realize my script is a little contrived but I'm trying to track down an elusive problem in our build system that is causing a lot of grief....this may or may not be the same problem but it's certainly a problem, so I thought I'd report it. 

Is there a workaround?

I've only ever seen this issue on Windows.

I did try running the same script on a vanilla windows machine and it did not fail. In fact, it does not always fail on the machine where it fails above. But once is enough to mess us up.


> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

Thanks,
Dan



[Rd] install.packages() removes package on Windows
Dan Tenenbaum