rstudio / rstudio/packrat

packrat should be forgiving about Repository setting

Open
#426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Currently, a packrat lockfile can look like:

PackratFormat: 1.4
PackratVersion: 0.4.8.51
RVersion: 3.3.3
Repos: NAME1=http://<some_repo>

Package: ISLR
Source: NAME2
Version: 1.2
Hash: 548250b957790df34ba5cb9387b740c1

Notice how the Source: Repo doesn't match the name of the recorded Repos. This causes restore to fail unless NAME2 happens to be CRAN.

Instead, packrat should always try to install packages from the Repos listed if a package record is from a CRAN-like repo (as determined during snapshot):

https://github.com/rstudio/packrat/blob/master/R/pkg.R#L323-L324

This type of lockfile happens when a client has a different name for their repo than the actual name of the repo housing the package, which is completely acceptable in R. Packrat works if the package source is CRAN, but is less forgiving otherwise.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at R/pkg.R lines 323-324 and inspect how snapshot records CRAN-like sources and restore resolves Repos entries. Reproduce the behavior with the lockfile shown, then verify that restore installs ISLR from a listed Repos entry despite the Source name mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.