Skip to content

Feature request: purge() many packages and their symlinks #2256

@malcolmbarrett

Description

@malcolmbarrett

The global cache is great, but I often find myself wanting to start from scratch for one reason or another, particularly confirming reproducibility. purge() is limited in three main ways for this

  • purge() only accepts one package at a time. I can get around this with lapply() + dependencies()
  • Usually, when I want this approach, it is precisely this workflow: purge all packages in the cache that this project uses. Again, I can combine it with dependencies() to meet that need, but ideally this would be streamlined with a new argument like purge_project
  • purge() does not remove symlinks. I think that could make sense as a default but I would like it if we could optionally remove the symlinks in the project, too. This would practically be limited to the project's symlinks and would still result in broken symlinks from any other project that used those packages from the cache.

Ideally, I would also be able to completely purge the entire cache (regardless of package and R version, project, etc) with something like purge_all.

Currently you can do this by just deleting the folder

# Retrieve the root cache path
cache_path <- renv::paths$root()

# Delete the entire cache directory recursively
unlink(cache_path, recursive = TRUE)   

but again, it would be nice to streamline this for reproducibility checks or other issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions