{"id":28325656,"url":"https://github.com/grailbio/rules_r","last_synced_at":"2025-06-23T15:31:00.399Z","repository":{"id":25502634,"uuid":"104124681","full_name":"grailbio/rules_r","owner":"grailbio","description":"R rules for Bazel","archived":false,"fork":false,"pushed_at":"2024-10-03T20:42:37.000Z","size":748,"stargazers_count":41,"open_issues_count":2,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-02T06:21:17.788Z","etag":null,"topics":["bazel","bazel-rules","r","rlang"],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grailbio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-19T20:24:42.000Z","updated_at":"2025-04-25T17:47:03.000Z","dependencies_parsed_at":"2023-11-08T04:07:57.351Z","dependency_job_id":"a19bca4f-86bc-4704-99cb-ff576235d283","html_url":"https://github.com/grailbio/rules_r","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/grailbio/rules_r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grailbio%2Frules_r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grailbio%2Frules_r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grailbio%2Frules_r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grailbio%2Frules_r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grailbio","download_url":"https://codeload.github.com/grailbio/rules_r/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grailbio%2Frules_r/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261504043,"owners_count":23168747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","bazel-rules","r","rlang"],"created_at":"2025-05-25T21:14:06.670Z","updated_at":"2025-06-23T15:31:00.388Z","avatar_url":"https://github.com/grailbio.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# R Rules for Bazel [![Tests](https://github.com/grailbio/rules_r/actions/workflows/tests.yml/badge.svg)](https://github.com/grailbio/rules_r/actions/workflows/tests.yml)\n\n#### General Information\n\n- [Overview](#overview)\n- [Getting Started](#getting-started)\n- [Configuration](#configuration)\n- [External Packages](#external-packages)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [Known Issues](#known-issues)\n\n#### Rules\n\n- [r_pkg](#r_pkg)\n- [r_library](#r_library)\n- [r_unit_test](#r_unit_test)\n- [r_pkg_test](#r_pkg_test)\n- [r_binary](#r_binary)\n- [r_test](#r_test)\n- [r_markdown](#r_markdown)\n- [r_toolchain](#r_toolchain)\n\n#### Repository Rules\n\n- [r_repository](#r_repository)\n- [r_repository_list](#r_repository_list)\n- [r_rules_dependencies](#r_rules_dependencies)\n- [r_coverage_dependencies](#r_coverage_dependencies)\n- [r_register_toolchains](#r_register_toolchains)\n\n#### Container Rules\n\n- [r_library_image](R/container/README.md#r_library_image)\n- [r_binary_image](R/container/README.md#r_binary_image)\n\n\u003ca name=\"overview\"\u003e\u003c/a\u003e\n\n## Overview\n\nThese rules are used for building [R][r] packages with Bazel. Although R has an\nexcellent package management system, there is no continuous build and\nintegration system for entire R package repositories. An advantage of using\nBazel, over a custom solution of tracking the package dependency graph and\ntriggering builds accordingly on each commit, is that R packages can be built\nand tested as part of one build system in multi-language monorepos.\n\nThese rules are mature for production use.\n\n\u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n\n## Getting started\n\nThe following assumes that you are familiar with how to use Bazel in general.\n\nTo begin, you can add the following or equivalent to your WORKSPACE file:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# Change master to the git tag you want.\nhttp_archive(\n    name = \"rules_r\",\n    strip_prefix = \"rules_r-master\",\n    urls = [\"https://github.com/grailbio/rules_r/archive/master.tar.gz\"],\n)\n\nload(\"@rules_r//R:dependencies.bzl\", \"r_register_toolchains\", \"r_rules_dependencies\")\n\nr_rules_dependencies()\n\nr_register_toolchains()\n```\n\nYou can load the rules in your BUILD file like so:\n\n```python\nload(\"@rules_r//R:defs.bzl\",\n     \"r_pkg\", \"r_library\", \"r_unit_test\", \"r_pkg_test\")\n```\n\nAdvanced users can also set up [Gazelle][gazelle] to maintain the BUILD files\nfor the R packages in their repo automatically.\n\n\u003ca name=\"configuration\"\u003e\u003c/a\u003e\n\n## Configuration\n\nThe following software must be installed on your system:\n\n    1. bazel (v5.0.0 or above)\n    2. R (4.1.2 or above; should be locatable using the `PATH` environment variable)\n\n**NOTE**: After re-installing or upgrading R, please reset the registered\ntoolchain with `bazel sync --configure` to rebuild your packages with the new\ninstallation.\n\n**NOTE**: It is possible to use R from a bazel package instead of a system\ninstallation. See the toolchain `r-toolchain-nix` in the tests directory as an\nexample.\n\nFor each package, you can also specify a different Makevars file that can be\nused to have finer control over native code compilation. The site-wide\nMakevars files are configured by default in the toolchains, and these define\nthe compiler toolchain to use and the flags needed for these toolchains for\nreproducible builds.\n\nFor _macOS_, this setup will help you cover the requirements for a large number\nof packages:\n\n```\nbrew install gcc pkg-config icu4c openssl\n```\n\nFor _Ubuntu_, this (or equivalent for other Unix systems) helps:\n\n```\napt-get install pkgconf libssl-dev libxml2-dev libcurl4-openssl-dev\n```\n\n#### Note\n\nFor no interference from other packages during the build (possibly other\nversions installed manually by the user), it is recommended that packages other\nthan those with recommended priority be installed in the directory pointed to\nby `R_LIBS_USER`. The Bazel build process will then be able to hide all the\nother packages from R by setting a different value for `R_LIBS_USER`.\n\nWhen moving to Bazel for installing R packages on your system, we recommend\ncleaning up existing machines:\n\n```\nsudo Rscript \\\n  -e 'options(\"repos\"=\"https://cloud.r-project.org\")' \\\n  -e 'lib \u003c- c(.Library, .Library.site)' \\\n  -e 'non_base_pkgs \u003c- installed.packages(lib.loc=lib, priority=c(\"recommended\", \"NA\"))[, \"Package\"]' \\\n  -e 'remove.packages(non_base_pkgs, lib=lib)'\n\n# If not set up already, create the directory for R_LIBS_USER.\nRscript \\\n  -e 'dir.create(Sys.getenv(\"R_LIBS_USER\"), recursive=TRUE, showWarnings=FALSE)'\n```\n\nFor more details on how R searches different paths for packages, see\n[libPaths][libPaths].\n\n\u003ca name=\"external-packages\"\u003e\u003c/a\u003e\n\n## External packages\n\nTo depend on external packages from CRAN and other remote repos, you can define the\npackages as a CSV with three columns -- Package, Version, and sha256. Then use\n[r_repository_list](#r_repository_list) rule to define R repositories for each\npackage. For packages not in a CRAN like repo (e.g. github), you can use\n[r_repository](#r_repository) rule directly. For packages on your local system\nbut outside your main repository, you will have to use `local_repository` with\na saved BUILD file. Same for VCS repositories.\n\n```\nload(\"@rules_r//R:repositories.bzl\", \"r_repository\", \"r_repository_list\")\n\n# R packages with non-standard sources.\nr_repository(\n    name = \"R_plotly\",\n    sha256 = \"24c848fa2cbb6aed6a59fa94f8c9b917de5b777d14919268e88bff6c4562ed29\",\n    strip_prefix = \"plotly-a60510e4bbce5c6bed34ef6439d7a48cb54cad0a\",\n    urls = [\n        \"https://github.com/ropensci/plotly/archive/a60510e4bbce5c6bed34ef6439d7a48cb54cad0a.tar.gz\",\n    ],\n)\n\n# R packages with standard sources.\n# See below for an example of how to generate the CSV package_list.\nr_repository_list(\n    name = \"r_repositories_bzl\",\n    build_file_overrides = \"@myrepo//third-party/R:build_file_overrides.csv\",\n    package_list = \"@myrepo//third-party/R:packages.csv\",\n    remote_repos = {\n        \"BioCsoft\": \"https://bioconductor.org/packages/3.14/bioc\",\n        \"BioCann\": \"https://bioconductor.org/packages/3.14/data/annotation\",\n        \"BioCexp\": \"https://bioconductor.org/packages/3.14/data/experiment\",\n        \"CRAN\": \"https://cloud.r-project.org\",\n    },\n)\n\nload(\"@r_repositories_bzl//:r_repositories.bzl\", \"r_repositories\")\n\nr_repositories()\n```\n\nThe list of all external R packages configured this way can be obtained from\nyour shell with\n\n```\n$ bazel query 'filter(\":R_\", //external:*)'\n```\n\n**NOTE**: Periods ('.') in the package names are replaced with underscores\n('\\_') because bazel does not allow periods in repository names.\n\nTo generate and maintain a CSV file containing all your external dependencies\nfor use with `r_repository_list`, you can use the functions in the script\n`repo_management.R`.\n\nFor example:\n\n```bash\nscript=\"/path/to/rules_r/scripts/repo_management.R\"\npackage_list_csv=\"/path/to/output/csv/file\"\npackages=\"comma-separated list of packages you want to add to the local cache\"\nbioc_version=\"bioc_version to use, e.g. 3.11\"\n\n# This will be the cache directory for a local copy of all the packages.\n# The output CSV will always reflect the state of this directory.\nlocal_r_repo=\"${HOME}/.cache/r-repo\"\n\nRscript - \u003c\u003cEOF\nsource('${script}')\npkgs \u003c- strsplit('${packages}', ',')[[1]]\n# Set ForceDownload to TRUE when switching R or Bioc versions.\n# options(\"ForceDownload\" = TRUE)\n# Keep in sync with r_repository_list in WORKSPACE.\noptions(repos = c(\n    BioCsoft = \"https://bioconductor.org/packages/${bioc_version}/bioc\",\n    BioCann = \"https://bioconductor.org/packages/${bioc_version}/data/annotation\",\n    BioCexp = \"https://bioconductor.org/packages/${bioc_version}/data/experiment\",\n    CRAN = \"https://cloud.r-project.org\")\n)\naddPackagesToRepo(pkgs, repo_dir = '${local_r_repo}')\npackageList('${local_r_repo}', '${package_list_csv}')\nEOF\n```\n\n\u003ca name=\"examples\"\u003e\u003c/a\u003e\n\n## Examples\n\nSome examples are available in the tests directory of this repo.\n\n- See [tests/packages/exampleA][exampleA] for a barebones R package.\n- See [tests/packages/exampleB][exampleB] for a barebones R package that depends on another package.\n- See [tests/packages/exampleC][exampleC] for an R package that depends on external R packages and\n  user native code libraries.\n- See [tests/packages/exampleD][exampleD] for an R package that depends on external R packages which\n  have been built with bazel provided native code libraries instead of a system requirement.\n\nAlso see [Razel scripts][scripts] that provide utility functions to generate `BUILD` files\nand `WORKSPACE` rules.\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n\n## Contributing\n\nContributions are most welcome. Please submit a pull request giving the owners\nof this github repo access to your branch for minor style related edits, etc. We recommend\nopening an issue first to discuss the nature of your change before beginning work on it.\n\n\u003ca name=\"known-issues\"\u003e\u003c/a\u003e\n\n## Known Issues\n\nPlease check open issues at the github repo.\n\n# Rules\n\n\u003ca name=\"r_pkg\"\u003e\u003c/a\u003e\n\n## r_pkg\n\n```python\nr_pkg(srcs, pkg_name, deps, cc_deps, build_args, install_args, config_override,\n      roclets, roclets_deps, makevars, env_vars, inst_files, tools, build_tools,\n      metadata)\n```\n\nRule to install the package and its transitive dependencies in the Bazel\nsandbox, so it can be depended upon by other package builds.\n\nThe builds produced from this rule are tested to be byte-for-byte reproducible\nwith the same R installation. For native code compilation, the compiler flags\nfor reproducibility are defined in the default site Makevars file in the local\ntoolchain. If using your own toolchain, ensure that your site Makevars file has\nthe right flags.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eImplicit output targets\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e\u003ci\u003ename\u003c/i\u003e.bin.tar.gz\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        Binary archive of the package.\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e\u003ci\u003ename\u003c/i\u003e.tar.gz\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        Source archive of the package.\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e\u003ci\u003ename\u003c/i\u003e.so\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        Shared archive of package native code; empty file if package does not\n        have native code.\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esrcs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of files, required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eSource files to be included for building the package.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003epkg_name\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eName of the package if different from the target name.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edeps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eR package dependencies of type `r_pkg` or `r_library`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ecc_deps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003ecc_library dependencies for this package.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ebuild_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; default [\"--no-build-vignettes\", \"--no-manual\"]\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional arguments to supply to R CMD build. Note that building\n           vignettes is disabled by default to not require Tex installation for\n           users. In order to build vignettes, override this attribute, and ensure\n           that the relevant binaries are available in your system default\n           PATH (usually /usr/bin and /usr/local/bin)\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003einstall_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional arguments to supply to R CMD INSTALL.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003econfig_override\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eReplace the package configure script with this file.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eroclets\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eroclets to run before installing the package. If this is non-empty,\n           then you must specify roclets_deps as the R package you want to\n           use for running roclets. The runtime code will check if devtools\n           is available and use `devtools::document`, failing which, it will\n           check if roxygen2 is available and use `roxygen2::roxygenize`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eroclets_deps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eroxygen2 or devtools dependency for running roclets.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003emakevars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional Makevars file supplied as R_MAKEVARS_USER.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eenv_vars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExtra environment variables to define for building the package.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003einst_files\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eLabel keyed Dictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eFiles to be bundled with the package through the inst directory.\n           The values of the dictionary will specify the package relative\n           destination path. For example, '' will bundle the files to the top level\n           directory, and 'mydir' will bundle all files into a directory mydir.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExecutables that code in this package will try to find in the system.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ebuild_tools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExecutables that native code compilation will try to find in the system.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003emetadata\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString keyed Dictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eMetadata key-value pairs to add to the DESCRIPTION file before building.\n           When text is enclosed within `{}`, bazel volatile and stable status\n           files will be used to substitute the text. Inclusion of these files in\n           the build has consequences on local and remote caching. Also see `stamp`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003estamp\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eInteger; default -1\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eSame behavior as the stamp attribute in cc_binary rule.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_library\"\u003e\u003c/a\u003e\n\n## r_library\n\n```python\nr_library(pkgs, library_path)\n```\n\nExecutable rule to install the given packages and all dependencies to a user\nprovided or system default R library. Run the target with --help for usage\ninformation.\n\nThe rule used to provide a tar archive of the library as an implicit output.\nThat feature is now it's own rule -- `r_library_tar`. See documentation for\n[r_library_tar rule][r_library_tar] and [example][docker] usage for\ncontainer_image rule.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003epkgs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels, required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003ePackage (and dependencies) to install.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003elibrary_path\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eIf different from system default, default library location for installation.\n        For runtime overrides, use bazel run [target] -- -l [path].\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_unit_test\"\u003e\u003c/a\u003e\n\n## r_unit_test\n\n```python\nr_unit_test(pkg, suggested_deps, env_vars, tools, data)\n```\n\nRule to keep all deps in the sandbox, and run the provided R test scripts.\n\nWhen run with `bazel coverage`, this rule will also produce a coverage report\nin Cobertura XML format. The coverage report will contain coverage for R code\nin the package, and C/C++ code in the `src` directory of R packages.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003epkg\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eLabel; required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eR package (of type r_pkg) to test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esuggested_deps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eR package dependencies of type `r_pkg` or `r_library`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eenv_vars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExtra environment variables to define before running the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExecutables to be made available to the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edata\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eData to be made available to the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_pkg_test\"\u003e\u003c/a\u003e\n\n## r_pkg_test\n\n```python\nr_pkg_test(pkg, suggested_deps, check_args, env_vars, tools, data)\n```\n\nRule to keep all deps of the package in the sandbox, build a source archive\nof this package, and run R CMD check on the package source archive in the\nsandbox.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003epkg\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eLabel; required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eR package (of type r_pkg) to test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esuggested_deps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eR package dependencies of type `r_pkg` or `r_library`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003echeck_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; default [\"--no-build-vignettes, \"--no-manual\"]\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional arguments to supply to R CMD build. Note that building\n           vignettes is disabled by default to not require Tex installation for\n           users. In order to build vignettes, override this attribute, and ensure\n           that the relevant binaries are available in your system default\n           PATH (usually /usr/bin and /usr/local/bin)\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eenv_vars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExtra environment variables to define before running the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExecutables to be made available to the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edata\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eData to be made available to the test.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_binary\"\u003e\u003c/a\u003e\n\n## r_binary\n\n```python\nr_binary(name, src, deps, data, env_vars, tools, rscript_args, script_args)\n```\n\nBuild a wrapper shell script for running an executable which will have all the\nspecified R packages available.\n\nThe target can be executed standalone, with `bazel run`, or called from other\nexecutables if \u003ccode\u003eRUNFILES_DIR\u003c/code\u003e is exported in the environment with\nthe runfiles of the root executable.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esrc\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAn Rscript interpreted file, or file with executable permissions.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edeps\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eDependencies of type \u003ccode\u003er_binary\u003c/code\u003e, \u003ccode\u003er_pkg\u003c/code\u003e,\n           or \u003ccode\u003er_library\u003c/code\u003e.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edata\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eFiles needed by this rule at runtime.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eenv_vars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExtra environment variables to define before running the binary.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eExecutables to be made available to the binary.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003erscript_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eIf src file does not have executable permissions, arguments for the\n           Rscript interpreter. We recommend using the shebang line and giving\n           your script execute permissions instead of using this.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003escript_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eA list of arguments to pass to the src script.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_test\"\u003e\u003c/a\u003e\n\n## r_test\n\n```python\nr_test(name, src, deps, data, env_vars, tools, rscript_args, script_args)\n```\n\nThis is identical to [r_binary](#r_binary) but is run as a test.\n\n\u003ca name=\"r_markdown\"\u003e\u003c/a\u003e\n\n## r_markdown\n\n```python\nr_markdown(name, src, deps, data, env_vars, tools, rscript_args, script_args,\nrender_function=\"rmarkdown::render\", input_argument=\"input\", output_dir_argument=\"output_dir\",\nrender_args)\n```\n\nThis rule renders an R markdown through generating a stub to call the render\nfunction. The render function and the argument names for the function are\ndefault set for `rmarkdown::render` but can be customized. Note that\n`render_args` will need to be quoted appropriately if set. This rule can be\nused wherever an [r_binary](#r_binary) rule can be used.\n\nIf arguments are given on the command line when running the target, flags of\nthe form --arg=value are passed as keyword arguments to the render\nfunction. The values can be arbitrary R expressions, and strings will need to\nbe quoted. The last argument without the prefix `--` will be the output\ndirectory, else the output directory will be the default output\ndirectory of the render function, typically the same directory as the input\nfile.\n\n\u003ca name=\"r_toolchain\"\u003e\u003c/a\u003e\n\n## r_toolchain\n\n```python\nr_toolchain(r, rscript, version, args, makevars_site, env_vars, tools, files, system_state_file)\n```\n\nToolchain to specify the tools and environment for performing build actions.\nAlso see [r_register_toolchains](#r_register_toolchains) for how\nto configure the default registered toolchains.\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003er\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; default R\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAbsolute path to R, or name of R executable; the search path will include the directories for tools attribute.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003erscript\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; default Rscript\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAbsolute path to Rscript, or name of Rscript executable; the search path will include the directories for tools attribute.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eversion\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eIf provided, ensure version of R matches this string in x.y form. This version check is\n           performed in the `r_pkg` and `r_binary` (and by extension, `r_test` and `r_markdown`)\n           rules. For stronger guarantees, perform this version check when generating the\n           `system_state_file` (see attribute below).\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eargs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; default [\"--no-save\", \"--no-site-file\", \"--no-environ\"]\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eArguments to R and Rscript, in addition to `--slave --no-restore --no-init-file`.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003emakevars_site\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eLabel; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eSite-wide Makevars file.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eenv_vars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eEnvironment variables for BUILD actions.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional tools to make available in PATH.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003efiles\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of labels; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eAdditional files available to the BUILD actions.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esystem_state_file\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eLabel; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eA file that captures your system state. Use it to rebuild all R packages whenever the\n           contents of this file change. This is ideally generated by a repository_rule with\n           `configure = True`, so that a call to `bazel sync --configure` resets this file.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n# Repository Rules\n\n\u003ca name=\"r_repository\"\u003e\u003c/a\u003e\n\n## r_repository\n\n```python\nr_repository(urls, strip_prefix, type, sha256, build_file, rscript)\n```\n\nRepository rule in place of `new_http_archive` that can run razel to generate\nthe BUILD file automatically. See section on\n[external packages](#external-packages) and [Razel scripts][scripts].\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eurls\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eURLs from which the package source archive can be fetched.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003estrip_prefix\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eThe prefix to strip from all file paths in the archive.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etype\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eType of the archive file (zip, tgz, etc.).\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003esha256\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003esha256 checksum of the archive to verify.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ebuild_file\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eOptional BUILD file for this repo. If not provided, one will be generated.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003erazel_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eOther arguments to supply to buildify function in razel.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003erscript\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eName, path or label (must start with `@` or `//`) of the interpreter to use\n           for running the razel script.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_repository_list\"\u003e\u003c/a\u003e\n\n## r_repository_list\n\n```python\nr_repository_list(package_list, build_file_overrides, remote_repos, other_args, rscript)\n```\n\nRepository rule that will generate a bzl file containing a macro, to be called\nas `r_repositories()`, for `r_repository` definitions for packages in\n`package_list` CSV. See section on [external packages](#external-packages).\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003epackage_list\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; required\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eCSV containing packages with name, version and sha256; with a header.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ebuild_file_overrides\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eFile; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eCSV containing package name and BUILD file path; with a header.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eremote_repos\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eRepos to use for fetching the archives.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eother_args\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eDictionary; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eOther arguments to supply to generateWorkspaceMacro function in razel.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003erscript\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eName, path or label (must start with `@` or `//`) of the interpreter to use\n           for running the razel script.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003er_version\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eIf provided, ensure version of R matches this string in x.y form.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003ca name=\"r_rules_dependencies\"\u003e\u003c/a\u003e\n\n## r_rules_dependencies\n\n```python\nload(\"@rules_r//R:dependencies.bzl\", \"r_rules_dependencies\")\n\nr_rules_dependencies()\n```\n\nRepository rule that provides repository definitions for dependencies of the\nBUILD system. One such dependency is the site-wide Makevars file.\n\n\u003ca name=\"r_coverage_dependencies\"\u003e\u003c/a\u003e\n\n## r_coverage_dependencies\n\n```python\nload(\"@rules_r//R:dependencies.bzl\", \"r_coverage_dependencies\")\n\nr_coverage_dependencies()\n\nload(\"@r_coverage_deps_bzl//:r_repositories.bzl\", coverage_deps = \"r_repositories\")\n\ncoverage_deps()\n```\n\nRepository rule that provides repository definitions for dependencies in\ncomputing code coverage for unit tests. Not needed if users already have\na repository definition for the [covr](https://github.com/r-lib/covr) package.\n\n\u003ca name=\"r_register_toolchains\"\u003e\u003c/a\u003e\n\n## r_register_toolchains\n\n```python\nload(\"@rules_r//R:dependencies.bzl\", \"r_register_toolchains\")\n\nr_register_toolchains(r_home, strict, makevars_site, version, args, tools)\n```\n\nRepository rule that generates and registers a platform independent toolchain\nof type [r_toolchain](#r_toolchain) based on the user's system and\nenvironment. If you want to register your own toolchain for specific platforms,\nregister them before calling this function in your WORKSPACE file to give them\npreference.\n\n**NOTE**: These toolchains read your system state and cache the findings for\nfuture runs. Whenever you install a new R version, or if you want to reset the\ntoolchain for any reason, run:\n\n```bash\nbazel sync --configure\n```\n\n\u003ctable class=\"table table-condensed table-bordered table-params\"\u003e\n  \u003ccolgroup\u003e\n    \u003ccol class=\"col-param\" /\u003e\n    \u003ccol class=\"param-description\" /\u003e\n  \u003c/colgroup\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth colspan=\"2\"\u003eAttributes\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003er_home\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString, optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eA path to `R_HOME` (as returned from `R RHOME`). If not specified,\n           the rule looks for R and Rscript in `PATH`. The environment variable\n           `BAZEL_R_HOME` takes precendence over this value.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003estrict\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eBool; default True\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eFail if R is not found on the host system.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003emakevars_site\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eBool; default True\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eGenerate a site-wide Makevars file.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eversion\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eString; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eversion attribute value for r_toolchain.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eargs\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; default [\"--no-save\", \"--no-site-file\", \"--no-environ\"]\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003eargs attribute value for r_toolchain.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003etools\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003e\u003ccode\u003eList of strings; optional\u003c/code\u003e\u003c/p\u003e\n        \u003cp\u003etools attribute value for r_toolchain.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n[r]: https://cran.r-project.org\n[gazelle]: gazelle\n[scripts]: scripts\n[libPaths]: https://stat.ethz.ch/R-manual/R-devel/library/base/html/libPaths.html\n[r_library_tar]: R/internal/library.bzl\n[docker]: R/container/README.md\n[exampleA]: tests/packages/exampleA\n[exampleB]: tests/packages/exampleB\n[exampleC]: tests/packages/exampleC\n[exampleD]: tests/packages/exampleD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrailbio%2Frules_r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrailbio%2Frules_r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrailbio%2Frules_r/lists"}