Skip to content

connect-content: add cmake and libabsl-dev so R s2 (and sf) can build from source #184

Description

@cgraham-rs

Problem

R's s2 package (a hard dependency of sf) can't be built from source in the Ubuntu connect-content images. s2 needs either system Abseil (libabsl-dev) or cmake to build its vendored copy, and the images have neither. So any content that depends on sf fails during package restore when no binary is available. This happens, for example, when packages come through a CRAN proxy that serves source only.

Seen with posit/connect-content:R4.3.3-python3.14.6-ubuntu-24.04-pro and s2 1.1.9.

The rest of the sf stack is already covered (libgdal-dev, libgeos-dev, libproj-dev, libudunits2-dev), so s2 is the only piece still missing.

Root cause

None of the package lists in connect-content/template/deps/ include cmake or libabsl-dev:

  • ubuntu-22.04_packages.txt.jinja2
  • ubuntu-24.04_packages.txt.jinja2
  • ubuntu-26.04_packages.txt.jinja2

#169 already noted that cmake is absent from every OS version. Other packages that fall back to vendored builds hit the same gap.

Proposed fix

  • 24.04 and 26.04: add cmake and libabsl-dev to the package lists.
  • 22.04: add cmake. Check whether jammy's libabsl-dev is new enough for s2. If it isn't, cmake alone lets s2 build its vendored Abseil.
  • Re-render with bakery update files --image-name connect-content.
  • If image size is a concern, this could be limited to the std variants and left out of min.

Workaround

Build a derived image:

FROM posit/connect-content:<tag>
RUN apt-get update && apt-get install -y --no-install-recommends cmake libabsl-dev && rm -rf /var/lib/apt/lists/*

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customer requestRequested by customerdockerRelated to container images we produce

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions