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

Groundhog 3.0.0 won't load some packages #91

Closed frederic-santos closed 1 year ago

frederic-santos commented 1 year ago

Hi,

Since the v3.0.0 update, I get some error messages simply when trying to load a package:

> library(groundhog)
Attached: 'Groundhog' (Version: 3.0.0)
Tips and troubleshooting: https://groundhogR.com

> groundhog.library(pkg = "gstat", date = "2023-04-15")
Will copy 3 packages

... 1Copying spacetime from groundhog's to R's default library.
Erreur dans if (outcome == TRUE) unlink(from[k]) : 
  la condition est de longueur > 1

No quick fix (such as groundhog:::load.cran.toc(TRUE), or even removing the whole R_groundhog folder and try a new install from scratch) did work. Similar error messages were obtained for other packages.

Is it a bug, or is there simply some new config to do with v3.0.0?

Thanks!

urisohn commented 1 year ago

Hi, Thanks. Will look into it.

  1. Did you install from CRAN?
  2. What's your operating system?

Uri

frederic-santos commented 1 year ago

Yep, it was installed from CRAN; and I'm using Linux (and R 4.2.3). Thanks!

urisohn commented 1 year ago

OK. Thanks, while i look into it, you can use meta.groundhog() to use the previous version. meta.groundhog('2023-04-01') for example. Sorry. More info soon.

urisohn commented 1 year ago

OK, I found the bug. Working on it.

urisohn commented 1 year ago

The problem is with the backup method for copying packages. groundhog relies on renaming, but if that fails it moves on to copying and deleting, and that's where the bug was. I tested extensively but did not test the backup method enough. For some reason you are relying on the backup method.

If you run: try.renaming.method.again() It will... try again method 1. My guess is that, since you tried already setting up a new groundhog folder, you will again be moved on to method #2 and will again fail, but it would be useful to know what triggers it. If you don't mind. Could you try: try.renaming.method.again() then run groundhog.library(pkg = "gstat", date = "2023-04-15") and report back?

urisohn commented 1 year ago

I pushed the commit with the fix to this bug. Cannot test extensively till tomorrow afternoon or Thursday. Till then you can install v3.0.0.9001 from github or from the groundhog server install.packages('https://groundhogr.com/groundhog_3.0.0.9001.tar.gz')

Thanks again, and sorry again. This was such a massive revision, that despite hours and hours of testing some bugs were going to make it through.

frederic-santos commented 1 year ago

Hi Uri, Many thanks, the issue is gone with the latest version you pushed! And don't be sorry, your package is so great that minor issues like this one are perfectly harmless compared to the benefits of using groundhog 😉 !

(I might have another (unrelated) minor conflict issue with this version, but I need to investigate a bit further before opening another issue if needed.)

Congrats for this v3 and see you! F.