← Back to all sparks
P

packrat

INFRA · APIS
Velocity0.0

Packrat is a dependency management system for R. Contribute to rstudio/packrat development by creating an account on GitHub.

R's old dependency manager now runs on a vendored copy of its own successor.

dependency-managementreproducibilitylegacypackage-repositoriesr-package
Current state
packrat was R's project dependency manager before renv replaced it, and its recent releases describe a package in careful retirement. It vendors renv internally and uses it for dependency detection and authenticated downloads, so several release notes amount to updating that bundled copy. The remaining work is repository plumbing: recognising Bioconductor packages that now carry a Repository field, handling CRAN-like, Nexus and older Artifactory archive layouts, and renaming downloads from r-universe that do not follow the expected filename pattern.
Where it's heading
Development here is about keeping existing projects restorable rather than making packrat a better choice for new ones. Nearly every entry is a fix for an environment that changed underneath it — a repository layout, a service's authentication scheme, a distribution's URL format. The vendoring of renv is the clearest statement of direction: the successor's logic is doing the work, wrapped in the old interface.
Prediction
Expect further releases only when package repositories change shape or the vendored renv needs refreshing, at roughly the two-year cadence the recent history shows. Nothing suggests new capability, and the practical migration path remains renv itself.

Recent moves

  1. 1y ago

    Handles Bioconductor detection and varied repository layouts

    A batch of repository-compatibility fixes: Bioconductor packages were being misidentified as CRAN because their DESCRIPTION files now include a Repository field, and downloads now try CRAN-like, Nexus and older Artifactory archive paths in turn. The vendored renv was refreshed for Posit Package Manager URL handling on more Linux distributions.

    View source ↗
  2. 3y ago

    Restores packages installed from repository subdirectories

    A single fix for restoring packages that live in a subdirectory of a GitHub, GitLab or Bitbucket repository. Narrow, and typical of the maintenance this package now receives.

    View source ↗
  3. 3y ago

    Private repository restores; git credentials masked from installs

    Restoring from private GitHub, GitLab and Bitbucket repositories becomes possible via the vendored renv and token environment variables. The more interesting half is defensive: Packrat now hides common git service credentials from the subprocesses that install packages, so a package build script cannot read them.

    View source ↗
  4. 4y ago

    GitLab private repos authenticate via GITLAB_PAT

    Fixes private GitLab and Bitbucket archive downloads and replaces username and password authentication with GITLAB_PAT, which is what GitLab actually supports. Tracking an upstream service's authentication change rather than any decision here.

    View source ↗
  5. 4y ago

    Bundles renv for dependency detection; adds authenticated downloads

    The release where the successor moves inside: a bundled renv takes over dependency detection to avoid evaluation side-effects, and authenticated downloaders arrive for the three git hosts. It also stops relying on a devtools function that had been removed upstream, the recurring hazard of a package built on other packages' internals.

    View source ↗
  6. 4y ago

    Breaking: cache directory now includes an R version suffix

    A breaking change to the cache layout so binaries compiled against different R versions no longer share a directory, with manual migration required for existing caches. It fixes a real correctness problem — there is no guarantee packages built for one R minor version work on the next.

    View source ↗