r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
678 stars 63 forks source link

Helper for migrating pkgs across R versions #61

Open jimhester opened 6 years ago

jimhester commented 6 years ago

This has been a question a number of different times, some I can recall are @jennybc's workshop at RStudio::conf, @OmaymaS on twitter (https://twitter.com/OmaymaS_/status/1004468608028807170) and elsewhere.

The general consensus is that typically people take the time to re-build their library from scratch, but this is somewhat painful in practice.

Copying packages directly across R versions is problematic, and enumerating across all R packages in the old library is both tricky (due to GH packages + recommended packages) and often overkill.

One potentially useful way to do this would be to copy only packages which had an OS access time less than a cutoff (maybe 30 days by default), which would let you copy all packages that have been recently in use. We could use the RemoteSHA information in the DESCRIPTION to retrieve GH packages as needed.

This would let you fairly easily re-build the useful set of packages from an old library with one call, and take away a lot of the pain when upgrading to a new R version.

jennybc commented 6 years ago

I think also interesting to at least record current state, i.e. what you have in which library and each package's version (or, if installed from GitHub, SHA). Even if you don't attempt to restore it all. I have a hacky script where I write this sort of csv for myself before upgrading R and rebuilding my library.

krlmlr commented 5 years ago

I think we should just rebuild the library from scratch. This can be done once every three months overnight, even for larger libraries.