packrat::restore deletes sources then complains it can't find them
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 409
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
I'm experiencing odd behavior.
I using packrat to control the production R environment, but deploying to production and calling restore does strange things. At first go it removes sources of the package I want to restore. It then complains it can't find the sources.
I do the following:
- packrat::install_local("ga.data") # on development system
- rsync the packrat dir using --delete, over to the production environment's packrat dir
- start R in production environment's packrat dir
- packrat::restore() # on production system
- go back to repeat the rsync
- restore again, this time it works.
Odd. In my setup this is reproducing every time.
Here is the text output from a terminal as I go through the steps:
## After rsync of development system to the production system, sources
## of a particular package, ga.data, looks like this:
tl@gamap(/var/www/profileplotter/perl/R_Home)$ ll packrat/src/ga.data/
total 6492
-rw-rw-r--+ 1 tl tl 1070060 May 9 10:14 ga.data_1.3.7-10.tar.gz
-rw-r--r--+ 1 tl tl 1070072 May 9 10:14 ga.data_1.3.7-24.tar.gz
-rw-r--r--+ 1 tl tl 1070288 May 9 10:14 ga.data_1.3.7-30.tar.gz
-rw-r--r--+ 1 tl tl 1131170 May 9 10:14 ga.data_1.3.8-3.tar.gz
-rw-r--r--+ 1 tl tl 1131817 May 9 10:14 ga.data_1.3.9-3.tar.gz
-rw-r--r--+ 1 tl tl 1131821 May 24 13:39 ga.data_1.3.9-5.tar.gz
## entering R to restore - it complains it can't find 1.3.9_5
tl@gamap(/var/www/profileplotter/perl/R_Home)$ R -q
Packrat mode on. Using library in directory:
- "/var/www/profileplotter/perl/R_Home/packrat/lib"
> packrat::restore()
Replacing ga.data (upgrade 1.3.9-3 to 1.3.9-5) ... Error in installPkg(pkgRecord, project, repos, lib) :
Failed to install ga.data (1.3.9-5): sources missing at /var/www/profileplotter/perl/R_Home/packrat/src/ga.data/ga.data_1.3.9-5.tar.gz
In addition: Warning message:
In packrat::restore() :
The most recent snapshot was generated using R version 3.5.3
> packrat::restore()
Installing ga.data (1.3.9-5) ...
Error in installPkg(pkgRecord, project, repos, lib) :
Failed to install ga.data (1.3.9-5): sources missing at /var/www/profileplotter/perl/R_Home/packrat/src/ga.data/ga.data_1.3.9-5.tar.gz
In addition: Warning message:
In packrat::restore() :
The most recent snapshot was generated using R version 3.5.3
>
Save workspace image? [y/n/c]:
## And indeed, now that particular source (and a bunch of other sources is gone)
tl@gamap(/var/www/profileplotter/perl/R_Home)$ ll packrat/src/ga.data/
total 1108
-rw-rw-r--+ 1 tl tl 1129979 May 24 13:42 ga.data_1.3.9-1.tar.gz
## I repeat rsync the packrat dir from development system, now the sources are back again:
tl@gamap(/var/www/profileplotter/perl/R_Home)$ ll packrat/src/ga.data/
total 6492
-rw-rw-r--+ 1 tl tl 1070060 May 24 13:42 ga.data_1.3.7-10.tar.gz
-rw-r--r--+ 1 tl tl 1070072 May 24 13:42 ga.data_1.3.7-24.tar.gz
-rw-r--r--+ 1 tl tl 1070288 May 24 13:42 ga.data_1.3.7-30.tar.gz
-rw-r--r--+ 1 tl tl 1131170 May 24 13:42 ga.data_1.3.8-3.tar.gz
-rw-r--r--+ 1 tl tl 1131817 May 24 13:42 ga.data_1.3.9-3.tar.gz
-rw-r--r--+ 1 tl tl 1131821 May 24 13:42 ga.data_1.3.9-5.tar.gz
## And this time restore works:
tl@gamap(/var/www/profileplotter/perl/R_Home)$ R -q
Packrat mode on. Using library in directory:
- "/var/www/profileplotter/perl/R_Home/packrat/lib"
p> packrat::restore()
Installing ga.data (1.3.9-5) ...
OK (built source)
Warning message:
In packrat::restore() :
The most recent snapshot was generated using R version 3.5.3
>
Save workspace image? [y/n/c]:
tl@gamap(/var/www/profileplotter/perl/R_Home)$
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packrat::restore() and the packrat/src/ga.data source directory, reproducing the reported rsync --delete sequence after packrat::install_local(). Done means restore no longer removes the available source archives and successfully installs ga.data 1.3.9-5 on the first attempt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100