← Back to all sparks
P

pkgbuild

INFRA · APIS
Velocity0.0

Find tools needed to build R packages and compile them from source

A package whose release calendar is written by whoever ships the next Rtools.

build-toolsrtoolsr-libdevtoolsmaintenancewindows
Current state
pkgbuild is the layer devtools and pak use to run R CMD build and R CMD INSTALL, and most of what it does is know where the compiler is. Six of its last eight releases are about Rtools: supporting Rtools43, 44 and 45, finding installations that did not come from an installer, reading the Windows registry correctly again, and handling aarch64 Windows when the expected environment variable is unset. The feature surface is a handful of Config/build/* DESCRIPTION options for packages with unusual build needs.
Where it's heading
This is maintenance defined entirely by other people's release schedules — R minor versions, Rtools versions, and the DESCRIPTION options downstream package authors ask for. The one structural change worth noting is that on R 4.3 and later the package stopped special-casing Windows and now tests for build tools by compiling a small package, the same way it always has on Unix. That is the direction: fewer platform branches, more probing.
Prediction
Expect the next release to add support for whichever Rtools ships alongside the next R minor version, and expect the Windows registry lookups to keep shrinking as the compile-probe approach proves out.

Recent moves

  1. 1y ago

    never-clean build option; aarch64 Windows Rtools detection

    Adds a Config/build/never-clean DESCRIPTION option so packages can suppress --preclean when header files change, fixes Rtools detection on aarch64 Windows when RTOOLS45_AARCH64_HOME is unset, and fixes binary builds from non-standard filenames. The ARM Windows fix is the recurring theme; the build option is an escape hatch for a specific downstream complaint.

    View source ↗
  2. 1y ago

    Windows build-tool detection now probes by compiling

    Adds R 4.5.x and Rtools45 support, and stops explicitly checking for Rtools on Windows from R 4.3.0 onward — has_build_tools() now compiles a small package to find out, the same way it works on Unix. That is one fewer platform branch in the part of the toolchain most likely to be wrong.

    View source ↗
  3. 1y ago

    Fix Rtools 4.3 and 4.4 discovery on Windows

    Finds Rtools 4.3 and 4.4 when they were not installed from an installer, and fixes registry-based detection for those versions. Two fixes to the same lookup path.

    View source ↗
  4. 2y ago

    Support R 4.4.x and Rtools44

    A single line adding R 4.4.x and Rtools44 support. The clearest illustration of what most of this package's releases are.

    View source ↗
  5. 2y ago

    Drops crayon, rprojroot and prettyunits dependencies

    Drops the crayon, rprojroot and prettyunits dependencies. Small packages individually, but pkgbuild sits under both devtools and pak, so three fewer nodes here is three fewer nodes in a lot of installs.

    View source ↗
  6. 3y ago

    bootstrap.R now runs under pkgbuild_process and pak

    Makes bootstrap.R run under pkgbuild_process so it also works when invoked from pak. A one-line fix to make the two build paths behave the same.

    View source ↗