Build tdigest for Ubuntu 20.04 (focal) — PG11–16 pipeline - #1239
Open
Buket (aybuket) wants to merge 3 commits into
Open
Buket (aybuket) wants to merge 3 commits into
Buket (aybuket) wants to merge 3 commits into
Conversation
Rebuild tdigest .deb packages for Ubuntu 20.04 (focal) from upstream source, mirroring the focal PostGIS pipeline. PGDG dropped focal (focal-pgdg 404s, frozen archive stops at tdigest 1.4.3), so newer tdigest (default 1.4.5, memory-safety fixes) is rebuilt from upstream source + the frozen focal-era debian/ packaging. One multi-version source build emits postgresql-<major>-tdigest for PG12-16, signed via the debsigner image and smoke-tested in a stock ubuntu:20.04.
Buket (aybuket)
force-pushed
the
tdigest-focal
branch
from
September 10, 2026 17:43
494e14a to
439675c
Compare
Copilot started reviewing on behalf of
ibrahim halatci (ihalatci)
September 11, 2026 10:15
View session
There was a problem hiding this comment.
🟡 Changes recommended
Some advertised dispatch inputs fail because of a source-directory collision and unsupported PostgreSQL majors.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Builds, signs, and smoke-tests tdigest 1.4.6 packages for PostgreSQL 11–16 on Ubuntu 20.04.
Changes:
- Adds a focal builder using archived PGDG packaging.
- Adds package signing and validation workflow.
- Tests clean installation and upgrades from tdigest 1.4.3.
File summaries
| File | Description |
|---|---|
scripts/build_tdigest_focal |
Builds multi-version tdigest packages. |
scripts/smoke_test_focal_tdigest_debs |
Tests installation and upgrades. |
dockerfiles/focal-tdigest-builder/Dockerfile |
Defines the focal build environment. |
.github/workflows/build-tdigest-focal.yml |
Orchestrates build, signing, and testing. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+78
to
+88
| PKG_DIR="$(find "${WORK}" -maxdepth 1 -type d -name 'tdigest-*' -exec test -d '{}/debian' \; -print | head -1)" | ||
| [ -n "${PKG_DIR}" ] || { echo "ERROR: could not locate unpacked packaging source" >&2; exit 1; } | ||
|
|
||
| echo "==> [2/6] Fetch and verify upstream tdigest-${TDIGEST_VERSION}.tar.gz" | ||
| curl -4 -fsSL -o "tdigest-${TDIGEST_VERSION}.tar.gz" "${UPSTREAM_URL}" | ||
| echo "${TDIGEST_SHA256} tdigest-${TDIGEST_VERSION}.tar.gz" | sha256sum -c - | ||
|
|
||
| SRCDIR="${WORK}/tdigest-${TDIGEST_VERSION}" | ||
| rm -rf "${SRCDIR}" | ||
| tar xzf "tdigest-${TDIGEST_VERSION}.tar.gz" | ||
| cp -a "${PKG_DIR}/debian" "${SRCDIR}/debian" |
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.
What&Why
PGDG dropped Ubuntu 20.04 wholesale:
focal-pgdgnow 404s on its Release file, and the archived mirror that replaced it freezes at tdigest 1.4.3. Nothing newer is available to pin against, so keeping focal current means rebuilding tdigest from upstream source.This targets tdigest 1.4.6, the latest release — it carries the memory-safety and correctness work from recent versions (stricter NULL/empty validation, result clamping around rounding errors, interruptible long-running loops, plus 32-bit/arm64 build fixes).
What's here
debian/→dpkg-buildpackageThe signing hand-off (debsigner mount layout) and the
.ddeb→.debrename follow the conventions already established by the focal core pipeline, so nothing new is introduced on the publishing side.How the build is shaped
One source build covers every major — there's no per-major matrix and no
assemblestep. tdigest is a straightforward PGXS extension, and its Debian packaging is multi-version by construction:debian/pgversionsplus thepgxs_loopdebhelper add-on hand the major list topg_buildext, which emitspostgresql-<major>-tdigestfor each one in a single pass. The script narrowsdebian/pgversionsto the requested majors and regeneratesdebian/controlfromcontrol.in(pg_buildext updatecontrol), so only the intended packages are declared and built.There are no packaging gymnastics: each runtime
.debcarries its owntdigest.controland versioned SQL, with no split-scriptspackage and noupdate-alternativesbookkeeping.PostgreSQL range
The default is PG11–16. Upstream's own
make installcheckCI runs the full[18 17 16 15 14 13 12 11]matrix with no exclusions, so 11 and 12 compile and pass regression there. (The"PostgreSQL": "13.0.0"entry inMETA.jsonis stale PGXN prereq metadata — it contradicts that CI matrix and is never read by PGXS orpg_buildext.) On the archive side,postgresql-server-dev-11andpostgresql-11-tdigestare both reachable, so11is included in the enabled components.Integrity
The upstream tarball is sha256-pinned — GitHub publishes no detached signature, so the pin is the only integrity gate and must not silently degrade:
The frozen
debian/comes fromapt-get source tdigest=1.4.3-1.pgdg20.04+1, which validates it against the archive's signedRelease.What CI checks
.debmust contain an embedded_gpgmaint.extension/tdigest.controlandtdigest--<version>.sql.apt --fix-broken install.ubuntu:20.04, both paths that matter:CREATE EXTENSION tdigest, assertextversion, run a realtdigest_percentileaggregate on each major;ALTER EXTENSION tdigest UPDATE, re-verify.Locally I've confirmed the static pieces —
bash -non both scripts, YAML parse of the workflow, the sha256 pin against the real tarball, and PG11 support against upstream CI. The end-to-end build + smoke run happens in CI; thepush:trigger ontdigest-focalexercises it before it merges todevelop.Notes for reviewers
workflow_dispatch:tdigest_version(1.4.6),pg_versions(11 12 13 14 15 16),tdigest_sha256(blank → pinned default),run_tests(0).RUN_TESTS=1wires up the upstream regression suite but drags inpostgresql-all; worth a single dispatch to confirm before depending on it.DEB_REVISIONdefaults to1.citus20.04+1, giving1.4.6-1.citus20.04+1, which sorts cleanly above the frozen1.4.3-1.pgdg20.04+1.