Skip to contents

Clones the package source (or reuses clone_dir), then installs its dependency tree and the system libraries those dependencies need via uvr (uvr sync --install-system-deps), so a dependency needing a system library no longer fails the build. Transient failures are retried with exponential backoff.

Usage

install_pkg_sys_deps(
  package_name,
  tag,
  local_clone_dir,
  platform = NULL,
  aggressive_cleanup = FALSE,
  patches = NULL,
  arch = NULL,
  source_org_url = "https://github.com/cran",
  clone_dir = 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 installed into the build library before dependency installation. Defaults to NULL (no patching).

arch

(character)
Architecture, "amd64" or "arm64".

source_org_url

(character)
Git organization URL in which to search for the package sources. The final URL will a combination from this argument and the package name. This also implies that the package source must exist in a repository with the same name. Must be a https:// URL, local paths are not supported.

clone_dir

(character)
Path to an existing clone of the package source. When given, its DESCRIPTION is used as-is and nothing is cloned, so dependencies resolve against the exact source being built. When NULL, the package is cloned from source_org_url into local_clone_dir and removed afterwards.

Details

When patches apply, their pre-built binaries are installed into the build library first, so uvr sync keeps them instead of overwriting them with the unpatched CRAN build.