Skip to content
Prev 10805 / 21312 Next

[Bioc-devel] Using BiocInstaller with R 3.4.0 beta

On 04/11/2017 05:01 AM, Gordon K Smyth wrote:
The test is in this code chunk, from utils/R/packages.R

     for(lib in lib.loc) {
         if(noCache) {
             ret0 <- .readPkgDesc(lib, fields)
             if(length(ret0)) retval <- rbind(retval, ret0)
         } else {
             ## Previously used URLencode for e.g. Windows paths with drives
             ## This version works for very long file names.
             base <- paste(c(lib, fields), collapse = ",")
             ## add length and 64-bit CRC in hex (in theory, seems
             ## it is actually 32-bit on some systems)
             enc <- sprintf("%d_%s", nchar(base), .Call(C_crc64, base))
             dest <- file.path(tempdir(), paste0("libloc_", enc, ".rds"))
             if(file.exists(dest) &&
                file.mtime(dest) > file.mtime(lib) &&
                (val <- readRDS(dest))$base == base)
                 ## use the cache file
                 retval <- rbind(retval, val$value)
             else {
                 ret0 <- .readPkgDesc(lib, fields)
                 if(length(ret0)) {
                     retval <- rbind(retval, ret0)
                     ## save the cache file
                     saveRDS(list(base = base, value = ret0), dest)
                 }
             }
         }


where 'lib' is one of .libPaths(), 'dest' is one of

   dir(tempdir(), pattern="libloc_", full=TRUE)

and 'base' should be a character(1)

I think the code chunk has tried to cache the packages installed in each 
directory of .libPaths() (the saveRDS() line), and these are somehow 
corrupted on the second time through (I guess evaluating the readRDS()??).

For instance I have two paths in .libPaths() and after the first 
install.packages() I have

 > str(readRDS(dir(tempdir(), full=TRUE)[1]))
List of 2
  $ base : chr 
"/home/mtmorgan/bin/R-3-4-branch/library,Version,Priority,Depends,Imports,LinkingTo,Suggests,Enhances,License,Li"| 
__truncated__
  $ value: chr [1:29, 1:17] "base" "boot" "class" "cluster" ...
 > str(readRDS(dir(tempdir(), full=TRUE)[2]))
List of 2
  $ base : chr 
"/home/mtmorgan/R/x86_64-pc-linux-gnu-library/3.4-Bioc-3.5,Version,Priority,Depends,Imports,LinkingTo,Suggests,E"| 
__truncated__
  $ value: chr [1:513, 1:17] "abind" "acepack" "aCGH" "ADaCGH2" ...

I'm guessing that one of these files is corrupted somehow, but it's not 
obvious how. Can you use options(error=recover) and find the values that 
cause the conditional to fail?

Martin
This email message may contain legally privileged and/or...{{dropped:2}}