Skip to contents

This function uses a shared cache approach with safe concurrency controls:

  • Preserves shared pak cache to avoid redundant downloads/builds

  • Uses operation-specific mutexes to prevent cache corruption

  • Implements retry logic with exponential backoff for transient failures

  • Cleans up stale lock files automatically

Usage

install_pkg_sys_deps(
  package_name,
  tag,
  local_clone_dir,
  platform = platform,
  aggressive_cleanup = FALSE,
  patches = NULL,
  arch = NULL
)

Arguments

package_name

(character)
Package name

tag

(character)
Tag/version. Tags starting with "R-" are filtered out.

local_clone_dir

(character)
Path to clone git repos into

platform

(character)
Platform identifier

aggressive_cleanup

(logical)
Perform additional cache cleanup before installation

patches

Optional path to a patch registry directory containing a registry.json (and any referenced diff files). When set, matching packages are pre-built as patched binaries and served to pak during dependency installation. Defaults to NULL (no patching).

arch

(character)
Architecture

Details

The shared cache approach is preferred over isolation because:

  • Avoids redundant package downloads across builds

  • Reduces storage requirements and build times

  • Maintains cache benefits while ensuring thread safety