krlmlr / r-appveyor

Tools for using R with AppVeyor (https://appveyor.com)
132 stars 60 forks source link

Use version-specific package library #180

Closed jeroen closed 4 years ago

jeroen commented 4 years ago

A lot of people are currently seeing this (example here)

Installing dependencies
+ Rscript -e 'options(repos = c(CRAN = "https://cloud.r-project.org"), download.file.method = "auto"); remotes::install_deps(dependencies = TRUE, type="win.binary")'
Error: package 'remotes' was installed before R 4.0.0: please re-install it
Execution halted
Command exited with code 1

The problem is that they have cached the package library, but it is outdated. The solution is to flush the cache but many people don't know this.

The following versions the package library using the major part of the version, in the same way as R itself does when we do not set R_LIB_USER.

gaborcsardi commented 4 years ago

Still not quite ideal when $version is devel, but still an improvement on the current situation.

jeroen commented 4 years ago

@gaborcsardi what is the problem? That it uses C:\Rlibrary\dev? Or that it caches R-devel at all?

gaborcsardi commented 4 years ago

Yeah. Maybe we just should not cache dev? Although when dev is built from source, caching it does help a lot.

Anyway, it definitely improves all other cases, and it does not make the dev case worse, either.

jeroen commented 4 years ago

Indeed, r-appveyor uses R-patched by default, so this solves the problem for all those users.

There is no easy solution for cache invalidation in R-devel because we can't detect when the ABI has broken. However in practice, I think the users that are using appveyor with R-devel probably also know how to flush the cache.

krlmlr commented 4 years ago

Thanks!