---
title: "The 'pkgcheck' computational environment"
author:
  - "Mark Padgham"
date: "`r Sys.Date()`"
vignette: >
  %\VignetteIndexEntry{How to extend checks}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set (
    collapse = TRUE,
    warning = TRUE,
    message = TRUE,
    width = 120,
    comment = "#>",
    fig.retina = 2,
    fig.path = "README-"
)
options (repos = c (
    ropenscireviewtools = "https://ropensci-review-tools.r-universe.dev",
    CRAN = "https://cloud.r-project.org"
))
library (pkgcheck)
```

Results of running `pkgcheck` package on your local computer may differ from
results generated by rOpenSci's automated checking system. The
[`pkgcheck-action` GitHub
action](https://github.com/ropensci-review-tools/pkgcheck-action) provides a
standard computational system for running `pkgcheck`, and can be used to
trigger checks on every push to GitHub. Some packages may nevertheless depend
on other system libraries, or packages from other programming languages, that
are not included in the standard environment used by the
[`pkgcheck-action`](https://github.com/ropensci-review-tools/pkgcheck-action).
This vignette describes the computational environment for `pkgcheck`, including
advice on how it may be modified to ensure your package passes rOpenSci's
automated checks.

## The `pkgcheck` Docker container

Both
[`pkgcheck-action`](https://github.com/ropensci-review-tools/pkgcheck-action)
and rOpenSci's own checking system use the [Docker](https://docker.com)
container provided in [the `pkgcheck`
Dockerfile](https://github.com/ropensci-review-tools/pkgcheck/blob/main/Dockerfile).
This Docker environment builds on the [GitHub "runner"
images](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md),
with the first couple of hundred lines installing all system libraries needed
to replicate that environment.

That Docker environment also includes installations of:

- [NixOS](https://nixos.org/)
- The [Julia language](https://julialang.org/), along with the [JULL
installer](https://github.com/abelsiqueira/jill) to enable easy package
installation.
- A selection of pre-installed R packages, notably including several very large
yet commonly installed packages.
- The [`reticulate` package](https://rstudio.github.io/reticulate/), with an
associated virtual python environment, and any python packages needed in
rOpenSci's suite of packages.
- [`quarto`](https://quarto.org/) to enable packages to use quarto vignettes,
or documents in any other format provided by quarto.

## How to get your package to pass rOpenSci's 'pkgcheck' system

If you are preparing a package for submission, and it is failing
[`pkgcheck-action`](https://github.com/ropensci-review-tools/pkgcheck-action)
because of missing software, whether system dependencies not otherwise covered
in [`sysreqsdb`](https://github.com/r-hub/sysreqsdb#sysreqs), missing packages
from either Julia or python, or some other system requirement, you can first
modify your local [`pkgcheck-action` workflow
file](https://github.com/ropensci-review-tools/pkgcheck-action) to install
these requirements as additional "steps". Once you've got the `pkgcheck-action`
passing on your local repository, you may also submit a pull request to update
our own
[Dockerfile](https://github.com/ropensci-review-tools/pkgcheck/blob/main/Dockerfile)
with whatever additional system dependencies your package may require.