CredibilityLab / groundhog

Reproducible R Scripts Via Date Controlled Installing & Loading of CRAN & Git Packages
https://groundhogr.com/
GNU General Public License v3.0
78 stars 4 forks source link

Cannot install in R 3.5.3 #105

Closed smurpau closed 1 year ago

smurpau commented 1 year ago

When attempting install.packages("groundhog") in a fresh R 3.5.3 install (with RTools 3.5.0.4 installed and in the path), I receive the following error message:

Warning in readRDS(cran.times.path) : lzma decoder corrupt data
Warning in readRDS(gran.toc.path) :
  invalid or incomplete compressed data
groundhog says: the file cran.toc.rds seems to be corrupted, will update it.
trying URL 'http://s3.wasabisys.com/groundhog/cran.toc.rds'
Content type 'application/octet-stream' length 2091636 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

Error in readRDS(cran.toc.path) : 
  ReadItem: unknown type 116, perhaps written by later version of R
groundhog says: the file cran.times.rds seems to be corrupted, will update it.

With R 3.6.3, it appears to install fine:

Warning in readRDS(cran.times.path) : lzma decoder corrupt data
groundhog says: the file cran.toc.rds seems to be corrupted, will update it.
trying URL 'http://s3.wasabisys.com/groundhog/cran.toc.rds'
Content type 'application/octet-stream' length 2091636 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

groundhog says: the file cran.times.rds seems to be corrupted, will update it.
trying URL 'http://s3.wasabisys.com/groundhog/cran.times.rds'
Content type 'application/octet-stream' length 840704 bytes (821 KB)
==================================================
downloaded 821 KB

*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (groundhog)

But then fails when installing a package e.g.:

> groundhog.library("ggplot2", "2020-04-01", tolerate.R.version = "3.6.3")
Will now download 12 packages from GRAN
The 12 packages will be downloaded simultaneously in a single batch
     http://gran.groundhogr.com/windows/3.6/2020-04-01/backports_1.1.5.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/colorspace_1.4-1.zip
     http://gran.groundhogr.com/windows/3.6/2020-01-20/farver_2.0.3.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/isoband_0.2.0.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/MASS_7.3-51.5.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/mgcv_1.8-31.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/pkgload_1.0.2.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/processx_3.4.2.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/testthat_2.3.2.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-05/tibble_3.0.0.zip
     http://gran.groundhogr.com/windows/3.6/2019-05-11/utf8_1.1.4.zip
     http://gran.groundhogr.com/windows/3.6/2020-04-01/vctrs_0.2.4.zip
Error in utils::download.file(url.split[[bk]], zip.split[[bk]], quiet = TRUE,  :
  cannot download any files
Will now install 11 packages:
     Installing 1 of 11: backports_1.1.5.zip (25.8 KB)
     Installing 2 of 11: colorspace_1.4-1.zip (2.1 MB)
     Installing 3 of 11: farver_2.0.3.zip (1.2 MB)
     Installing 4 of 11: isoband_0.2.0.zip (1.8 MB)
     Installing 5 of 11: MASS_7.3-51.5.zip (610.8 KB)
     Installing 6 of 11: mgcv_1.8-31.zip (761.6 KB)
     Installing 7 of 11: pkgload_1.0.2.zip (44.2 KB)
     Installing 8 of 11: testthat_2.3.2.zip (294.7 KB)
     Installing 9 of 11: tibble_3.0.0.zip (155.7 KB)
     Installing 10 of 11: utf8_1.1.4.zip (44.2 KB)
     Installing 11 of 11: vctrs_0.2.4.zip (471.7 KB)
Error in `$<-.data.frame`(`*tmp*`, "pkg_vrs", value = "_") :
  replacement has 1 row, data has 0

Is there a minimum version of R that is supported by groundhog?

urisohn commented 1 year ago

Groundhog is tested with version R>=3.2.0, so it should work. But evidently it is not in your case.

It seems like this is a come-back of issue #100 for R 3.5 and maybe you have an older version of groundhog in R-3.6.

Not sure why it is happening again, thought that groundhog V3.1.1 had fixed it, can't look into it for a long term solution but will try to debug your situation.

Can you please try downloading the .rds file 'by hand' with these lines, but replace "c:/groundhog_folder/" with whatever path you have for the files now?

download.file("https://groundhogr.com/cran.toc.rds", 'c:/groundhog_folder/cran.toc.rds',mode='wb') download.file("https://groundhogr.com/cran.times.rds", 'c:/groundhog_folder/cran.times.rds',mode='wb') download.file("https://groundhogr.com/gran.toc/windows35.rds", 'c:/groundhog_folder/windows35.rds', mode='wb')

After you do I think R-3.5 will work. And then, if you switched to R3-.6 and installed groundhog from scratch, to get the newer version, it should work as well.

urisohn commented 1 year ago

OK, found the bug. It was indeed an imperfection in how issue #100 had been fixed, was working for R-3.5.0 but not for 3.5.x with x>0. Pushed the changes to Github and submitting the fix to CRAN right now, with v3.1.2

smurpau commented 1 year ago

Thanks, that works with 3.5.3