rstudio / rstudio/packrat

snapshot kind find source from LOCAL pkgs when that has CRAN

Open
#320 4 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

I'm relying on a local, newer version of a package that is also on CRAN.

That means, of course, that that package has in the DESCRIPTION

Repository: CRAN

When I now do some dev on this package locally, install it via packrat::install_local(pkgs = pkgs) and then run packrat::snapshot() I get:

> packrat::snapshot(prompt = FALSE)

Upgrading these packages already present in packrat:
               from      to
    qmethod   1.5.0   1.6.0

Fetching sources for qmethod (1.6.0) ... FAILED
Error in snapshotSources(project, activeRepos(project), allRecordsFlat) : 
  Errors occurred when fetching source files:
Error in getSourceForPkgRecord(pkgRecord, sourceDir, availablePkgs, repos) : 
  Couldn't find source for version 1.6.0 of qmethod (1.4.2 is current)

The problem disappears when I delete Repository: CRAN from the DESCRIPTION.

Intended Behavior? Odd? Bug?

I would think that this happens a lot when people use "fresher" versions than on CRAN ...

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

Reproduce the issue with packrat::install_local(pkgs = pkgs) followed by packrat::snapshot(prompt = FALSE), using a local package newer than its CRAN version. Start at snapshotSources and getSourceForPkgRecord, then verify that snapshot can identify the local source for the newer package despite Repository: CRAN in DESCRIPTION.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.