Skip to content

Package Compilation

On top of the dependencies section configuration available, rv provides additional configurations and controls for package installation.

  • prefer_repositories_for - Used to prefer repositories for dependencies that may be listed as Remotes in another package.
  • packages_env_vars - Used to specify package specific environment variables for compilation. Has no effect if the package is sourced as a binary.
  • configure_args - Used to specify package specific configure.args. Can be tuned by OS and arch. Has no effect if the package is sourced as a binary.
  • no_strip - Disable stripping of debug symbols (passed by default to R CMD INSTALL) for specific packages.
  • git_shorthand_base_url - Override the base URL used by the rv add owner/repo shorthand.

dev_dependencies and suggests are reserved fields for further dependency control, but are not yet implemented.

rproject.toml
[project]
name = "package compilation"
r_version = "4.5"
repositories = [
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" },
{ alias = "my-repo", url = "https://my-repo.com" },
]
dependencies = [
{ name = "foo", git = "https://github.com/org/foo", branch = "main" },
{ name = "data.table", force_source = true },
{ name = "archive", force_source = true },
]
git_shorthand_base_url = "https://git.mycompany.com/scm"
prefer_repositories_for = [
"bar",
]
no_strip = [
"archive",
]
[project.packages_env_vars."data.table"]
OPENMP_CFLAGS = ''
[project.configure_args]
"foo" = [
{ os = "macos", args = ["--some-flag"] },
]