## Motivation
R on the Alpine images was built without graphics support: `capabilities()` reports `cairo`, `png`, `jpeg` and `tiff` as `FALSE`, while Ubuntu reports all four `TRUE`.
The images install `R-dev` but never the graphics headers, and R's `configure` treats those as optional and does not fail when they are absent, so the build succeeds and ships an R that cannot draw.
Reproduced in a clean `alpine:3.22` container with the old package set:
```
Additional capabilities: PNG, NLS, ICU
Capabilities skipped: JPEG, TIFF, cairo
```
One correction to the original diagnosis: `--with-x=no` was not the cause, and libpng was in fact found.
R's bitmap and `pangocairo` checks run independently of `R_X11` (`configure.ac:2604` gates on `want_cairo`, not `use_X11`).
`capabilities("png")` needs a device *backend*, and with X11 off and cairo absent there was none, which is why all four read `FALSE` despite configure listing PNG.
So the fix is purely the missing `-dev` packages.
X11 stays off, which is correct for headless images, and cairo covers `png()` / `jpeg()` / `tiff()` / `svg()`.
## Changes
- `builder/Dockerfile.alpine-{320,321,322,323,324}` — install `pkgconf cairo-dev pango-dev fontconfig-dev freetype-dev libpng-dev jpeg-dev tiff-dev zlib-dev`; pass `--with-cairo --with-libpng --with-jpeglib --with-libtiff` explicitly so the intent sits next to `--with-x=no`; set `REQUIRED_CAPABILITIES`.
- `builder/build.sh` — add `verify_capabilities()` between `compile_r` and `package_r`. A build that loses a graphics device now fails instead of being packaged and uploaded. Opt-in via `REQUIRED_CAPABILITIES`, so every non-Alpine platform is untouched.
- `.crow/build.yaml` — add a `FORCE_REBUILD` escape hatch to the dedup step. Artifact filenames carry only the R version, so the HEAD probe would otherwise keep skipping every Alpine version and serving the stale broken binaries.
- `CLAUDE.md` — record the three gotchas.
## Verification
Compiled R 4.5.1 in the patched `alpine-322` image, through the real `build.sh`:
```
jpeg png tiff tcltk X11 aqua
TRUE TRUE TRUE TRUE FALSE FALSE
NLS Rprof profmem cairo ICU long.double
TRUE TRUE TRUE TRUE TRUE TRUE
All required capabilities are present.
```
The devices actually render, not just report `TRUE` (`default bitmapType: cairo`):
```
png -> t.png (2154 bytes)
jpeg -> t.jpeg (4489 bytes)
tiff -> t.tiff (120160 bytes)
svg -> t.svg (9381 bytes)
```
The guard was exercised in both directions against that real build: it passes on the four graphics capabilities, and returns non-zero naming the missing entry when additionally asked for `X11`.
`crow lint .crow/` passes and `bash -n builder/build.sh` is clean.
## Behaviour change
Alpine R binaries gain the cairo, png, jpeg and tiff devices, and link against `libcairo`, `libpangocairo`, `libpng`, `libjpeg` and `libtiff`.
The `.apk` metadata already declared those runtime dependencies, so consumer images need no change.
Any Alpine build that loses a graphics device now fails the pipeline rather than uploading silently.
**Needs a follow-up after merge:** the first run must have `FORCE_REBUILD` set, otherwise dedup skips every existing Alpine version and the broken artifacts stay in the bucket.
Reviewed-on: #9
In Debian 11, Pango now depends on PCRE2, so R 3.x will not be compiled with
Pango support if we hide PCRE2 to prevent R 3.5 and 3.6 from taking an unnecessary
dependency on PCRE2.
To check if R 3.x was compiled without Pango support, look for this line in the
configure output:
checking whether pkg-config knows about cairo and pango... no
Or in R, check if the "bitmapType" option defaults to "Xlib" instead of "Cairo":
> getOption("bitmapType")
"Xlib"
Martin Maechler, a member of R core provides a daily tarball of R-devel
sources at https://stat.ethz.ch/R/daily. This provides support for
building based on this source if R_VERSION is set to 'devel'
* Allows building deb packages for R on ubuntu-1804
this update provides a mechanism for building deb packages on Ubunto
1804. Several changes have been necessary to facilitate this:
* Dockerfile has been updated. It now includes:
- fpm - a tool tool to create OS specific packages
- copying the package script into the image
* the OS specific package.ubuntu-1804 packaging script
- this is the script that uses fpm to build the package
* Updates to build.sh. It now includes:
- runs the package script if it exists
- stores the resultant package to s3
* removed duplicate dependencies
* fixed minor bug with output directory creation
* moved package creation to after the clean step
* Changed deb priority to "optional"
The fpm default priority is "extra" which is now deprecated.
https://github.com/jordansissel/fpm/issues/1398
* Added additional package fields
Added 'Bugs', URL (Homepage), 'Description', 'Maintainer' and 'License'
* Fixed the repo URL
* Added passthrough for Jenkins BUILD_NUMBER
Jenkins sets the BUILD_NUMBER environment variable for all jobs.
This change sets that env var inside the container as BUILD_NO.
BUILD_NO is used bythe packaging scripts in place of a version number
for all of the created packages.
* removed liblapack
* Improved consistency of environment variable use
Removed the needless renaming of environment variables to improve
overall consistency and readability
* No longer tries to version the packages
Previous commits relied on the idea that the Jenkins BUILD_NUMBER
environment variable could be used as a version number for the package
itself (in addition to R's existing version numbers). This is not the
case and having a version number for the package is not deemed desirable
at this time. This change pins *all* packages produced to version 1.
* Moved additional apt package installations
Packages were being installed in two places, have rationalised to a
single location to reduce the number of layers in the final container.
* Tidy up of package script
Alphabetised the dependencies to make things easier to find.
* Added additional dependencies
These dependencies were added as they were identified to be missing when
running against the R 3.6.1 build during testing
* Removed an unrequired dependency
Further trimming down the dependency list based on reviewer feedback.
* Swapped liblapack-dev for libopenblas-dev
/usr/bin/pager is specific to Debian/Ubuntu. For other OSs, use the default
pager detected by the configure script, which will either be less or more.
See https://github.com/rstudio/r-builds/issues/3