HenrikBengtsson / revdepcheck.extras

R package: revdepcheck.extras - Reverse-Dependency Checks from the Command Line (CLI)
https://github.com/HenrikBengtsson/revdepcheck.extras
3 stars 0 forks source link

Improve how the crancache cache is pre-populated #1

Closed HenrikBengtsson closed 4 years ago

HenrikBengtsson commented 4 years ago

The pre-installation of packages is needed when the checks run on a machine without internet access, or without compiler tools. By pre-installing on a machine with those resources, the packages will be available for binary installation via 'crancache' cache.

Currently, the "preinstallation" runs crancache::install_packages() to a dummy target. This will reinstall packages already installed, which can takes unnecessary time. We can improve on this by checking which packages are already in the crancache cache using, e.g.

> done <- crancache::crancache_list()
> str(done)
'data.frame':   468 obs. of  4 variables:
 $ Package   : chr  "abind" "abind" "affxparser" "affy" ...
 $ Repository: chr  "cran-bin/source" "cran/platform" "bioc/platform" "bioc/platform" ...
 $ Version   : chr  "1.4-5" "1.4-5" "1.60.0" "1.66.0" ...
 $ MD5sum    : chr  "1e3bc3f6c1d6d2ee4af270f70996875f" "136f981e1c4f618b64a87faaa7797c97" "46a3636ae91c4b2104e2b83c43060db3" "a1ea1f504dd64a44c8bc383b459dc154" ...

This doesn't account for available updates upstream (CRAN and Bioconductor) so we probably need to compare to available.packages() too, e.g.

> db <- crancache::available_packages()

✔ 188 MiB 
> table(db[,"Repository"])

file:////home/hb/.cache/R-crancache/x86_64-pc-linux-gnu-library/4.0-custom/bioc/src/contrib 
                                                                                         27 
file:////home/hb/.cache/R-crancache/x86_64-pc-linux-gnu-library/4.0-custom/cran/src/contrib 
                                                                                        240 
                                    https://bioconductor.org/packages/3.11/bioc/src/contrib 
                                                                                       1853 
                         https://bioconductor.org/packages/3.11/data/annotation/src/contrib 
                                                                                        961 
                         https://bioconductor.org/packages/3.11/data/experiment/src/contrib 
                                                                                        390 
                               https://bioconductor.org/packages/3.11/workflows/src/contrib 
                                                                                         27 
                                                    https://cloud.r-project.org/src/contrib 
                                                                                      15878