What does it mean when a package is stale?

731 views
Skip to first unread message

Jacqueline Buros Novik

unread,
Sep 1, 2015, 6:22:35 PM9/1/15
to packrat-discuss

First I want to say, I love packrat & am grateful to Rstudio & the developers for making this. We are using it in our deploy process for code quite regularly.

I am, however, running into repeated problems primarily around stale packages. When I call "packrat::snapshot()", I almost always get a message that a particular package that I have just installed is stale.

The workflow is usually : 

```
Open a project in Rstudio
Install or upgrade a package 
Test the code / application
Run packrat::status()  ## confirm that upgrade is noticed by packrat (sometimes it isn't)
Run packrat::snapshot()  ## get message that the installed package is stale
```

I have looked around & am not sure what packrat means by "stale". What can I do to avoid this?

I have a follow-up to this scenario, but will ask separately.

 


Kevin Ushey

unread,
Sep 10, 2015, 5:44:33 PM9/10/15
to packrat-discuss
Hi Jacqueline,

We use the term 'stale' to denote packages that are:

    1) Installed by packrat (e.g. presumedly by a restore), but
    2) Are different from the versions recorded in the lockfile.

It's possible that this is a 'bug' in the sense that it's a holdover of when we did a more complex juggling of the state between the 'last restored' library state, and the 'current' library state.

The logic now should be simplified in that:

    1) 'snapshot' ==> 'save the current status of my packrat library'
    2) 'restore' ==> 'apply my last snapshot to the library'

so it's possible that the logic around 'stale' packages can just go away.

I'm glad to hear that packrat has been successful in becoming part of your deployment story!

Thanks,
Kevin

Jacqueline Buros Novik

unread,
Sep 11, 2015, 1:36:32 PM9/11/15
to packrat-discuss
Thanks for this explanation! I am keeping track of scenarios where this happens & will post if I find one that's repeatable :) 

(in case it helps, for now it's only been repeatable when I am working in more than one git branch in my workflow -- which is consistent with your definitions of staleness)

In the meantime, I look forward to a future version where stale-ness is no longer an issue :) 

brando...@gmail.com

unread,
Feb 18, 2019, 3:30:15 PM2/18/19
to packrat-discuss
Hi Jacqueline,

I'm having the same problem. Did you ever find a solution to it?

Thanks,
Brandon

Ken Williams

unread,
May 17, 2019, 10:13:13 AM5/17/19
to packrat-discuss
I just posted a question on this same issue on Stack Overflow, along with how I solved it:

Eric Kernfeld

unread,
Aug 12, 2019, 6:32:38 PM8/12/19
to packrat-discuss
Thanks for helping maintain this fantastic tool! For better reproducible science, I am currently getting into packrat, and I am packratifying some longstanding projects with many dependencies. Calling init() and then snapshot() results in an error asking me to restore seven packages. I called restore(), which ran without errors, and seemed to install all the same versions that I already had and that were supposedly stale. Then calling snapshot() gives the exact same stale packages error as before. Is it possible the comparison between library and lockfile is broken? Do you recommend I just skip that comparison, as Ken does, by using ignore_stale=TRUE?


On Thursday, September 10, 2015 at 5:44:33 PM UTC-4, Kevin Ushey wrote:
Reply all
Reply to author
Forward
0 new messages