Skip to content

Verify extension builds on PG18 + Python 3.14 - #21

Merged
adsharma merged 5 commits into
add-pr-cifrom
pg18-build-check
Oct 5, 2026
Merged

adsharma merged 5 commits into
add-pr-cifrom
pg18-build-check

Conversation

@adsharma

@adsharma adsharma commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Stacks on #20.

Problem

When someone sends an updated version of a Postgres extension (a version bump in pgbuild/Makefile), there is no verification that it still builds.

What this adds

  • pgbuild/Makefile: parameterize the Postgres major version via PG_MAJOR (default 17, so all existing builds are unchanged). The postgres branch (REL_<major>_STABLE) and the cargo pgrx init --pg<major> flags derive from it. Verified via dry-run that PG_MAJOR=18 selects REL_18_STABLE/--pg18 and the default still selects 17.
  • .github/workflows/extension-build.yml (new): builds postgres + all extensions once on ubuntu x86_64 with Python 3.14 / PG18 by default, then runs the test suite against the freshly built binaries. Triggers on PRs touching pgbuild/**/Makefile, pushes to main touching those paths, and manual dispatch (with pg_major/python_version/extensions inputs to trial a bump before sending a PR).
  • Speed: all C/C++ compilation goes through ccache (cached across runs via actions/cache), cargo registry downloads are cached too.

Note: pgbuild/Makefile is tracked-but-gitignored, so it needed an explicit git add -f; the pgbuild/** path filter still matches it in PRs.

Parameterize the postgres major version in pgbuild/Makefile
(PG_MAJOR, default 17 so existing builds are unchanged) and add an
extension-build check workflow: on PRs touching the build, or on
demand, it builds postgres + all extensions once on ubuntu x86_64
(Python 3.14, PG18 by default) and runs the test suite against the
freshly built binaries.

C/C++ compilation goes through ccache and cargo downloads are cached
to keep repeat runs quick.
@adsharma
adsharma added this pull request to stack #22 October 5, 2026 19:57
noble has no clang-dev/llvm-dev; use clang + libclang-dev instead.
Latest cargo-pgrx (0.19.x) refuses to build extensions pinned to
pgrx 0.16.1, and 0.16.1 already supports Postgres 18, matching every
pgrx-based extension pin (pgvectorscale, pg_search).
Without it, install falls back to auto-discovered system postgres
(e.g. pg16 on GH runners) instead of the version registered via init.
This also makes PG_MAJOR actually take effect for pgrx extensions.
cargo pgrx install has no --pgXX flag; without --pg-config it uses
the first pg_config on PATH, which on runners with system postgres
silently builds the extension against the wrong major version.
@adsharma
adsharma merged commit 4c42778 into main Oct 5, 2026
5 checks passed
@adsharma
adsharma deleted the pg18-build-check branch October 5, 2026 23:14
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.

1 participant