rstudio / rstudio/packrat

Unreferenced packages marked as referenced

Open
#456 6 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

Hi,
I'm having trouble wrapping my head around how packrat identifies packages that are supposedly referenced in my code. Here's the beginning of the output of packrat::status().

The following packages are referenced in your code, but are not present
in your library nor in packrat:

    slam
    tm

You will need to install these packages manually, then use
packrat::snapshot() to record these packages in packrat.

I'm pretty sure I don't import any of these packages and according to their CRAN pages they don't appear in any of my other used packages reverse dependencies.
Even if I grep them in all of my source code, I can't find anything outside of the hidden .git repo of my project. Is it possible packrat looks for dependencies even in the git repo after the library is no longer used or mentioned (for example i referenced the package slam in a random script and then i realized i didn't need it but that reference still exists in an old commit and packrat thinks I still need it).
Note that there's no mention of either packages in packrat.lock.

What's even stranger is that I don't have this issue on another machine with the same project setup, this only occured after I cloned the project on a separate server and bootstrapped packrat.

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 by reproducing the report with packrat::status() after bootstrapping the cloned project, then compare the dependency scan with the source tree, hidden .git repository, and packrat.lock. Determine why unused slam and tm are reported despite not appearing in current code or packrat.lock; done means status no longer reports those unused packages without requiring them.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.