Skip to content

build-pg-focal: refresh the quilt series against the upstream being built - #1208

Merged
Kemal Büyükkaya (kemalbuyukkaya) merged 2 commits into
developfrom
pg-focal
Aug 17, 2026
Merged

build-pg-focal: refresh the quilt series against the upstream being built#1208
Kemal Büyükkaya (kemalbuyukkaya) merged 2 commits into
developfrom
pg-focal

Conversation

@kemalbuyukkaya

@kemalbuyukkaya Kemal Büyükkaya (kemalbuyukkaya) commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

14.24/15.19/16.15 add output_plugin_libraries to postgresql.conf.sample right below the trailing context of the Debian extension_destdir hunk. We pair a new orig tarball with the frozen focal-era debian/, so the patch stopped matching verbatim and PG14/15/16 failed (run 31801139919).

The [4/6] gate missed it because it was weaker than the real check: quilt push -a tolerates fuzz <= 2, while dpkg-source --before-build replays the same series in [6/6] with patch -F 0 and refuses it. PG13 was unaffected -- 13.23 doesn't touch that file.

Fix

[4/6] now refreshes the series against the upstream at hand, then gates on zero fuzz:

quilt push -a --refresh   # apply (fuzz allowed) + rewrite each patch's context
quilt pop -a
quilt push -a --fuzz=0    # what dpkg-source will do in [6/6]

Context and line numbers only, no +/- changes, in PGDG's patch style. A hunk that needed fuzz raises a CI annotation naming the patch and the file, since --refresh bakes that placement in and the gate can no longer catch it. A patch that doesn't apply at all points at PG_DROP_PATCHES. Frozen packaging plus moving upstream guarantees recurrence, hence a standing fix rather than a per-minor edit.

Verification

podman locally, plus CI (run 31805259613, all green): refreshed series yields a source tree byte-identical to the fuzzy one; 23 debs per major still linking libllvm10, signed; combined 59-deb set installs in stock ubuntu:20.04 with PG13/14/15/16 online and JIT available.

…uilt

PG14/15/16 could not build 14.24/15.19/16.15: those minors add
output_plugin_libraries to postgresql.conf.sample directly below the
extension_destdir hunk's trailing context, so the frozen focal-era patch
no longer matches verbatim.

The pipeline's own gate could not see it. Step [4/6] ran "quilt push -a",
and quilt applies with up to two lines of fuzz:

  Hunk #1 succeeded at 726 with fuzz 2 (offset 1 line)

Step [6/6] then let dpkg-source --before-build replay the same series
with "patch -t -F 0", which allows no fuzz at all:

  Hunk #1 FAILED at 725
  dpkg-source: info: the patch has fuzz which is not allowed, or is malformed
  dpkg-buildpackage: error: dpkg-source --before-build . subprocess returned exit status 2

So the gate passed and the build died 25 seconds later, one apt-install
of Build-Depends in. PG13 was unaffected only because 13.23 does not
touch postgresql.conf.sample.

Pairing a moving orig tarball with frozen debian/ packaging makes this
recur on every minor, so [4/6] now applies the series with fuzz allowed
and refreshes each patch as it goes ("quilt push -a --refresh"), which
rewrites patch context for the upstream at hand without changing a single
+/- line, then re-applies at --fuzz=0 to assert exactly what dpkg-source
is about to check. Patches that needed fuzz are named in the log: such a
hunk was placed on less context than its author wrote and is worth an
eyeball. Refreshing uses PGDG's own patch style (a/ b/ prefixes, no
timestamps, no Index:, @@ function context) so a refreshed patch still
diffs minimally against the shipped one.

PG_DROP_PATCHES keeps its narrower job: patches that cannot be applied at
all, such as hurd-iovec, merged upstream as of 16.14.

Verified locally with podman for 14.24, 15.19 and 16.15. The refreshed
series produces a source tree byte-identical to the one the original
series produces with fuzz, dpkg-source accepts it, and each major builds
its full 23-package set against focal's libllvm10. The combined
47-package set installs into a stock ubuntu:20.04 with all three clusters
online and JIT available, and every shipped postgresql.conf.sample
carries both extension_destdir and upstream's new output_plugin_libraries.
Comment thread scripts/build_pg_focal Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with minor comment, could be follow up

…ng us

Review feedback on #1208: --refresh turns the fuzz case from a build
failure into a log line, and the --fuzz=0 gate structurally cannot catch
a mis-placed hunk because refresh has already rewritten the context to
match. Low probability with PGDG's small patches, but it was the one
signal this change made quieter.

Fuzz now raises a CI annotation naming the patch and the file:

  ::warning::PG14: extension_destdir needed fuzz against 14.24 in
  src/backend/utils/misc/postgresql.conf.sample -- Hunk #1 succeeded at
  726 with fuzz 2 (offset 1 line).

One per hunk rather than a grouped summary, so the run page names what
drifted without anyone opening a 9000-line log. The runner parses these
from the container's stdout, as scripts/smoke_test_focal_debs already
relies on. Expect one per fuzzing major on every run: the focal packaging
is frozen, so that drift is permanent until the pin moves.

A patch that does not apply at all -- the hurd-iovec class, and the
likelier future failure -- died via set -e with nothing but quilt's
"does not apply (enforce with -f)". It now points at PG_DROP_PATCHES,
which is the fix and is not discoverable from quilt's message.

Also QUILTRC=/dev/null. patchfns sources /etc/quilt.quiltrc *after* the
environment (quilt/scripts/patchfns:31) using plain assignments, so
focal's rc silently won: QUILT_REFRESH_ARGS became "--no-timestamps
--backup", dropping "-p ab --no-index". Refreshed patches came out in
Index:/src.orig style rather than PGDG's a/ b/, plus a debian/patches/*~
backup for every patch. Harmless to the build -- dpkg-source strips -p1
either way, which is why the green run hid it -- but it made the comment
on those very lines false. My earlier verification could not see it: the
host harness ran quilt unpacked into a prefix, with no /etc/quilt.quiltrc
to source.

Verified in the focal image, which is the environment that has the rc
file: patches refresh in a/ b/ style with no backup litter, dpkg-source
accepts at zero fuzz, the injected non-applying patch prints the hint and
exits 1, and a full PG14 rebuild yields the same 23 packages at the same
versions as before.
@kemalbuyukkaya
Kemal Büyükkaya (kemalbuyukkaya) merged commit 18c5e89 into develop Aug 17, 2026
105 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants