Skip to contents

Configuration for running conan. Some common options and some specific to different provisioning methods.

Usage

conan_configure(
  method,
  ...,
  path_lib,
  path_bootstrap,
  cran = NULL,
  delete_first = FALSE,
  path = ".",
  envvars = NULL
)

Arguments

method

The method to use; currently script, pkgdepends, auto and renv are supported.

...

Additional arguments, method specific. See Details.

path_lib

The library to install into. Could be an absolute or a relative path.

path_bootstrap

The path to a bootstrap library to use. This needs to contain all the packages required for the method you are using. For script this is just remotes, but for pkgdepends it must contain the full recursive dependencies of pkgdepends.

cran

URL for use as the CRAN repo. If not given we will use the RStudio CRAN mirror. This option has no effect when using renv, as the URLs in your lock file determine the locations that packages are fetched from. The intended use of this option is for where a CRAN repo is misbehaving (e.g., returning 500 errors, or has an invalid/incomplete/out of date index). The most likely alternative version to use is cran = "https://cran.r-project.org"

delete_first

Should we delete the library before installing into it?

path

Path to the root where you would run conan from; typically this is the same path is the root of the project, often as the working directory.

envvars

Environment variables to set before running the installation. See Details for format.

Value

A list with class conan_config. Do not modify this object.

Details

Different methods support different additional arguments:

  • method script supports the argument script, which is the name of the script to run, defaults to "provision.R"

  • method pkgdepends supports the arguments refs, which can be a character vector of references (rather than reading from the file pkgdepends.txt) and policy which is passed through to pkgdepends::new_pkg_installation_proposal().

  • method auto takes an argument environment which contains a list of packages to install and source files to scan for dependencies.

  • method renv takes no arguments.

Setting environment variables while running the installation comes uses the envvars argument; this system is designed to play well with hipercow, though it does not require it. We expect a data.frame with columns name, value and (optionally) secret. If secret is given, it must be a logical value indicating that value has been encrypted with an rsa public key. If any secret is TRUE, then envvvars must also have an attribute key that contains the path to private rsa key to decrypt the secrets (i.e., attr(envvars, "key")). If you use secret environment variables, then the openssl package must be present in conan's bootstrap.