Repository navigation
Reduce macOS brew system requirement installs to XQuartz - #66
Merged
Merged
Conversation
Adds a self-test for this repo so changes to `setup-r-package` can be
validated here instead of by moving the `v1` tag and waiting for a
consumer repo to break.
Two jobs:
* `macos-deps` checks a small fixture package that declares the packages
`setup-macOS-dependencies` special-cases (`Cairo`, `terra`,
`textshaping`, `units`), plus an informational `RMySQL` leg. The
fixture loads each namespace rather than just installing it -- a
binary linked against a missing system library installs fine and then
fails to load -- and asserts `capabilities("cairo")` to cover the
`grDevices` entry, which is a base package and is never installed.
* `windows-httpuv` checks out `rstudio/httpuv` and builds it across
R devel, release, and `oldrel-1` through `oldrel-4`. It has `src/`,
needs compilation, and declares `R (>= 2.15.1)`, so every leg
exercises a real toolchain.
These deliberately do not call the reusable `R-CMD-check.yaml`. That
workflow references `setup-r-package@v1` internally, and GitHub Actions
does not allow expressions in `uses:`, so a local call would test the
released action rather than the branch. Instead the jobs check this repo
out at the workspace root and invoke `./setup-r-package` directly.
Also adds a `cache` passthrough input to `setup-r-package` (default
`"always"`, so existing behavior is unchanged). The integration jobs set
`cache: "false"` because a cache hit would restore packages instead of
resolving them, which is the thing being tested.
This commit intentionally leaves the macOS brew installs in place, so
the workflow can be shown green before they are removed.
`check-r-package` loads `rcmdcheck`, which is not a dependency of the fixture package, so the macOS job failed with "there is no package called 'rcmdcheck'". The Windows job already passed it via `extra-packages`.
Fixes #47 `setup-r-package` no longer calls `setup-macOS-dependencies`. Posit Public Package Manager serves macOS binaries, and `r-lib/actions/setup-r` uses them for Posit-owned organizations, so there are no system dependencies to build against. The brew step cost roughly 4.5 minutes per macOS job -- installing `pak` purely to resolve a dependency tree, then `brew install`-ing 11 formulae including the XQuartz cask -- while every package it cared about was already installing as a binary. `setup-macOS-dependencies` is kept and fully functional, not stubbed: `rstudio/shinycoreci` calls it directly and deliberately. It now emits a deprecation warning asking users to open an issue if they want it kept. Note that three of the nine entries in its `brew_list` can never match anymore: `rgdal` and `rgeos` are archived from CRAN, and `FreeType` has no CRAN archive at all.
`requireNamespace(quietly = TRUE)` swallowed the underlying error, so a
failure only reported "is not TRUE" without saying which system library
was missing. Load via `loadNamespace()` inside `tryCatch()`, print the
condition message, and collect every failure so one run reports the full
set. Also report `capabilities("X11")` alongside `cairo`.
Reverts the removal of `setup-macOS-dependencies` from `setup-r-package` and cuts `brew_list` down to the one entry that is still needed, with a comment recording why each of the others could go. The integration test showed that removing the step outright breaks `Cairo`: its macOS binary is linked against XQuartz (`/opt/X11/lib/libXrender.1.dylib`), which the runner image does not provide, so it installs cleanly and then fails to `dlopen`. `Cairo` is a declared dependency of `rstudio/shiny`, `rstudio/htmltools` and `rstudio/thematic`, so that would have been a real break. Everything else in the list can go. `terra`, `textshaping` and `units` load from PPM binaries; `RMySQL` loads from CRAN's macOS binary without `mariadb-connector-c`; `FreeType` is not on CRAN at all; `rgdal` and `rgeos` are archived. Keeping only the XQuartz cask drops ~4.5 minutes of `brew install` per macOS job to roughly 20 seconds. Two supporting changes: * `setup-r-package` now asks for `use-public-rspm: always` on macOS. `setup-r` otherwise enables macOS PPM binaries only for an allowlist of Posit-owned organizations, so the reduced brew list would have depended on which org happens to own the repo. The substitution is macOS-only: applying `always` everywhere would also override `setup-r`'s deliberate exclusion of non-Intel Windows, which has no binaries on the public PPM. * The integration jobs rewrite `rstudio/shiny-workflows/<name>@v1` refs inside `setup-r-package` to the SHA under test. Without this the jobs would exercise the released `v1` of every sibling action, so a change to `setup-macOS-dependencies` would not be tested at all. The deprecation warning is dropped: `setup-r-package` calls this action again, so warning every consumer that it is deprecated would be wrong.
…fixture The reduced `brew_list` is only safe because the integration fixture loads each affected package. A new entry added to the list without a matching fixture entry is untested, so record that expectation.
schloerke
force-pushed
the
schloerke/issue-47
branch
from
August 14, 2026 20:57
52267c0 to
f11cf9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #47
Summary
#47 asked to remove the macOS system requirement installs. Testing showed one of them is load-bearing, so this reduces
brew_listfrom nine entries to one rather than deleting the step.setup-macOS-dependenciesis kept and still called bysetup-r-package.What the test showed
This PR builds an integration workflow first, then uses it to make the call. Three runs, each on this branch:
Removing the step outright breaks
Cairo. Its macOS binary is linked against XQuartz and the runner image does not ship it, so it installs cleanly and then fails to load:That is the awkward version of this failure — installation succeeds, so nothing looks wrong until
dlopen.Cairois a declared dependency ofrstudio/shiny,rstudio/htmltoolsandrstudio/thematic, so this would have been a real break. Installing XQuartz also restorescapabilities("X11").Everything else in the list can go:
terra,textshaping,unitsRMySQLmariadb-connector-cneededFreeTypergdal,rgeoscairo,harfbuzzandfribidiare already on the runner image. Net effect: ~4.5 minutes ofbrew installper macOS job becomes ~20 seconds — most of the old cost wasgdaland friends.Supporting changes
use-public-rspm: alwayson macOS.setup-rotherwise enables macOS PPM binaries only for an allowlist of Posit-owned orgs, so the reduced brew list would have depended on which org owns the repo. Scoped to macOS deliberately: applyingalwayseverywhere would also overridesetup-r's exclusion of non-Intel Windows, which has no PPM binaries.cacheinput onsetup-r-package(default"always", no behavior change for existing callers). The integration jobs setcache: "false"— a cache hit would restore packages instead of resolving them, which is the thing being tested.CLAUDE.md: adding a package to a system-dependency list now requires adding it to the fixture, since the fixture is the only thing keeping the list honest.The integration workflow
Two jobs in
.github/workflows/test-integration.yaml:macos-deps— checks a fixture package declaring the affected packages, plus a non-blockingRMySQLleg. It loads each namespace rather than only installing it, which is the only way theCairofailure is visible, and assertscapabilities("cairo")to cover thegrDevicesentry (a base package, so never installed).windows-httpuv—rstudio/httpuvacross devel, release andoldrel-1..oldrel-4, confirming older toolchains still resolve. It hassrc/and needs compilation, so each leg exercises a real Rtools.Both bypass the reusable
R-CMD-check.yaml, and both rewriterstudio/shiny-workflows/<name>@v1refs to the SHA under test. GitHub Actions does not allow expressions inuses:, so without that rewrite the jobs would silently exercise the releasedv1of every sibling action — the reducedbrew_listwould not have been tested at all.Note for review
The branch keeps the remove-then-reduce history rather than squashing it, so the failing middle commit is the evidence for the final shape. Squash on merge.