[Rd] improving the performance of install.packages
hp@ge@ @end|ng |rom |redhutch@org
Sat Nov 9 00:34:02 CET 2019
Actually there is one gotcha here: even if a package has not changed
(i.e. same exact hash), there are situations where you want to reinstall
it because one package it depends on has changed. This is because some
of the stuff that gets cached at installation time (e.g. method table)
can become stale and needs to be resynced.
We sometimes have to deal with this kind of situation in Bioconductor
when we make changes to some infrastructure packages. To avoid package
caches to become out-of-sync on the user machine after the user gets the
new version of the infrastructure package, we also bump the versions of
all the reverse deps for which the cache needs to be resynced. A side
effect of the version bumps is to also trigger build and propagation of
new Windows and Mac binaries for the reverse deps affected by the
change, which is good, because they also need to be rebuilt and
reinstalled. This is an ugly situation but luckily a rare one and it
generally happens in BioC devel only.
On 11/8/19 15:05, Hervé Pagès wrote:
> Hi Gabe,
> Keeping track of where a package was installed from would be a nice
> feature. However it wouldn't be as reliable as comparing hashes to
> decide whether a package needs re-installation or not.
> On 11/8/19 12:37, Gabriel Becker wrote:
>> Hi Josh,
>> There are a few issues I can think of with this. The primary one is that
>> CRAN(/Bioconductor) is not the only place one can install packages
>> from. I
>> might have version x.y.z of a package installed that was, at the time, a
>> development version I got from github, or installed locally, etc. Hell I
>> might have a later devel version but want the CRAN version. Not common,
>> sure, but wiill likely happen often enough that install.packages not
>> that for me when I tell it to is probably bad.
>> Currently (though there has been some discussion of changing this)
>> do not remember where they were installed from, so R wouldn't know if the
>> version you have is actually fully the same one on the repository you
>> pointed install.packages to or not. If that were changed and we knew
>> we were getting the byte identical package from the actual same source, I
>> think this would be a nice addition, though without it I think it
>> would be
>> right a high but not high enough proportion of the time.
>> R will build the package from source (depending on what OS you're using)
>>> twice by default. This becomes especially burdensome when people are
>>> big packages (i.e. lots of depends) and someone has a script with:
>>> ... later on down the script
>> I mean, IMHO and as I think Duncan was alluding to, that's straight up an
>> error by the script author. I think its a few of them, actually, but
>> its at
>> least one. An understandable one, sure, but thats still what it is.
>> (which are meant to be run more than once, generally) usually shouldn't
>> really be calling install.packages in the first place, but if they do,
>> should certainly not be installing umbrella packages and the packages
>> bring with them separately.
>> Even having one vectorized call to install.packages where all the
>> are installed would prevent this issue, including in the case where the
>> user doesn't understand the purpose of the tidyverse package. Though the
>> installation would still occur every time the script was run.
>> The last thing to note is that there are at least 2 packages which
>> a function which does this already (install.load and remotes), so people
>> can get this functionality if they need it.
>> On Fri, Nov 8, 2019 at 11:56 AM Joshua Bradley <jgbradley1 using gmail.com>
>>> I assumed this list is used to discuss proposals like this to the R
>>> codebase. If I'm on the wrong list, please let me know.
>> This is the right place to discuss things like this. Thanks for starting
>> the conversation.
>> [[alternative HTML version deleted]]
>> R-devel using r-project.org mailing list
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024
E-mail: hpages using fredhutch.org
Phone: (206) 667-5791
Fax: (206) 667-1319
More information about the R-devel