You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue shows that packrat can restore from bundles in a source overlay directory but is unable to use those installed packages on subsequent restore. We are seeing this problem while using the packrat cache, but the steps here show that the cache is not necessary.
Create a toy package that we will "pretend" is on GitHub.
Create a tar.gz bundle using R CMD build completelyPrivatePackage.
Add that tar.gz into a "sources" directory with a fake-SHA filename.
Create a toy project that uses this package.
Restore that project (using the sources directory).
R --vanilla -s -f ./doit.R
Installing completelyPrivatePackage (0.1.0) ...
OK (built source)
Warning messages:
1: In packrat::restore(overwrite.dirty = TRUE, prompt = FALSE, restart = FALSE) :
The most recent snapshot was generated using R version 3.2.0
2: In untar(src, exdir = target, compressed = "gzip") :
argument 'compressed' is ignored for the internal method
3: In untar(src, compressed = "gzip", list = TRUE) :
argument 'compressed' is ignored for the internal method
On second run (after that successful restore):
R --vanilla -s -f ./doit.R
Error: Unable to retrieve package records for the following packages:
- 'completelyPrivatePackage'
In addition: Warning message:
In packrat::restore(overwrite.dirty = TRUE, prompt = FALSE, restart = FALSE) :
The most recent snapshot was generated using R version 3.2.0
Execution halted
The restore works by adding the following fields to the DESCRIPTION file within that sources tar.gz file:
With this additional metadata, the second restore succeeds:
R --vanilla -s -f ./doit.R
Already up to date.
Warning message:
In packrat::restore(overwrite.dirty = TRUE, prompt = FALSE, restart = FALSE) :
The most recent snapshot was generated using R version 3.2.0
Note: You'll need to remove the packrat/lib when switching between the original and augmented source bundles.
It feels as if packrat is seeing the presence of a tar.gz in the sources directory:
This issue shows that packrat can restore from bundles in a source overlay directory but is unable to use those installed packages on subsequent restore. We are seeing this problem while using the packrat cache, but the steps here show that the cache is not necessary.
tar.gz
bundle usingR CMD build completelyPrivatePackage
.tar.gz
into a "sources" directory with a fake-SHA filename.example `packrat.lock`
In my toy project, I have a
source-overlay
directory that contains:Here is a restore script that uses this overlay directory:
On first run (no
packrat/lib
):On second run (after that successful restore):
The restore works by adding the following fields to the
DESCRIPTION
file within that sourcestar.gz
file:With this additional metadata, the second restore succeeds:
Note: You'll need to remove the
packrat/lib
when switching between the original and augmented source bundles.It feels as if packrat is seeing the presence of a
tar.gz
in the sources directory:packrat/R/restore.R
Lines 91 to 92 in 448aafd
That prevents us from adding
DESCRIPTION
fields associated with GitHub packages:packrat/R/restore.R
Lines 307 to 328 in 448aafd
We add fields for other types of repositories (bitbucket, gitlab, etc). Packages from these sources probably have the same issue.
The text was updated successfully, but these errors were encountered: