Hi there,
I've been transitioning my projects over to renv
and in general have been pleased with the experience. I ran into the following hiccup while updating packages.
I noticed that renv::update()
fails out when attempting to compile some packages from source. I couldn't find an option to force update()
to update from binary where possible, so I went in by hand with renv::install()
to install the offending packages (at least the ones I encountered).
Then, when using renv::install(pkg, type = "binary")
, I noticed that for these offending packages, setting type = "binary"
didn't seem to change the CRAN package link that renv
was installing from.
For example:
renv::install("mgcv", type = "source")
Retrieving 'https://cran.rstudio.com/src/contrib/mgcv_1.8-33.tar.gz' ...
OK [file is up to date]
Installing mgcv [1.8-33] ...
FAILED
Error installing package 'mgcv':
================================
errors here
renv::install("mgcv", type = "binary")
Retrieving 'https://cran.rstudio.com/src/contrib/mgcv_1.8-33.tar.gz' ...
OK [file is up to date]
Installing mgcv [1.8-33] ...
FAILED
Error installing package 'mgcv':
================================
same errors here
renv
appears to be retrieving the source tarball in both cases.
I encountered the problem with the following packages:
- binary version is older than source:
-
conquer
,mgcv
-
- binary version is equal to source:
-
data.table
,rstanarm
-
I was able to get these packages to install by copying the direct link to the binary, e.g. renv::install("https://cran.rstudio.com/bin/macosx/contrib/4.0/mgcv_1.8-32.tgz")
.
While I don't know how update()
works under the hood, it does seem to be correctly sourcing the binary links for most packages, so I'm guessing the default behavior is indeed to update from binary where possible. renv
seems not to be detecting binary links for these packages in particular, either for install()
or update()
. Not sure what's happening with some of these guys!
Is there something I should be changing, or is this an issue for others as well?