Skip to content

pgserver: Add version 0.1.4 - #2276

Open
luhenry wants to merge 4 commits into
mainfrom
pgserver
Open

luhenry wants to merge 4 commits into
mainfrom
pgserver

Conversation

@luhenry

@luhenry luhenry commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Compiles PostgreSQL 16.2 and the pgvector 0.6.2 extension from source and bundles the resulting install tree as a self-contained embedded postgres server. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-and-test.yml.

Differs from upstream

  • Nothing beyond the riscv64 image.

Testing

  • same as upstream

License: Wheel bundles PostgreSQL 16.2 and pgvector 0.6.2 (both the permissive, non-copyleft PostgreSQL License); upstream ships neither license text, so the build adds them.

Patches

  • 0001-Add-LICENSE.postgresql-and-LICENSE.pgvector-matching.patch - To upstream, not submitted from this port run. Without it, dist-info/licenses/ omits both bundled projects' license text.

pgserver bundles a self-contained postgres server, compiling PostgreSQL
16.2 and the pgvector 0.6.2 extension from source via its own Makefile
(cibuildwheel before-all = "make"), not a vendored prebuilt binary.
Neither PostgreSQL's spinlock/atomics fallback (generic gcc __sync
builtins) nor pgvector 0.6.2 (no SIMD dispatch at this version) gate on
architecture, so this is an ordinary build-from-checkout port mirroring
upstream's own manylinux cibuildwheel job.
Add 0001-Add-LICENSE.postgresql-and-LICENSE.pgvector-matching.patch:
the checkout carries no license text for the PostgreSQL or pgvector
sources it compiles and bundles into every wheel, so neither reaches
dist-info/licenses/. Apply it before the build and assert both land
in the wheel alongside pgserver's own LICENSE.
luhenry added a commit that referenced this pull request Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2276/

Built to branch gh-pages at 2026-09-24 16:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

All four riscv64 build legs failed identically after 30+ minutes,
partway through compiling pgvector (fetched and built by pgserver's
own pgbuild/Makefile): GCC on manylinux_2_39_riscv64 rejects
`-march=native` outright ("ISA string must begin with rv32 or rv64"),
which pgvector's Makefile passes unconditionally except for Mac ARM
and ppc64.

Add patches/pgserver/0.1.4/0002-*.patch, overriding OPTFLAGS to empty
on the pgbuild/Makefile invocations that build pgvector, the same way
pgvector's own Makefile already blanks it for architectures that
reject -march=native. Verified the patch applies cleanly (alone and
together with the existing 0001 licensing patch) against a fresh
v0.1.4 checkout.

check_commit_messages was failing on an older run (35966092162) but
passes on the current HEAD's latest run; no commit-message change
needed.
cp312/cp313/cp314 all reproduced the same crash identically across three
independent riscv64 runners: pgserver's from-source-built initdb dies with
SIGSEGV on its very first invocation (test_get_server), and on every
invocation after. That is real and, without riscv64 hardware to debug
interactively, unresolved (documented as gotcha 564 in a follow-up
bookkeeping commit to main) - configure correctly detects native
__sync/__atomic builtins and the build passes no aggressive flags, so it
isn't an obvious atomics-fallback or -march problem.

What's actionable now: test_reuse_deleted_datadir_short starts a server in
a multiprocessing.Process and then blocks on queue.get() with no timeout;
when the child dies from the initdb segfault it never puts anything on the
queue, so the parent (and the whole job) hangs until the workflow's
180-minute timeout kills it - a full runner-hour cycle spent confirming a
crash pytest had already reported seconds in. Bound it from the workflow
side (gotcha 563): CIBW_TEST_REQUIRES: pytest-timeout plus
PYTEST_ADDOPTS="--timeout=300" folded into the existing CIBW_ENVIRONMENT
line, which cibuildwheel applies to both the build and test phases. No
patch to pgserver's own source needed - its test-command has no room to
pass extra pytest flags, but CIBW_ENVIRONMENT reaches it anyway.
luhenry added a commit that referenced this pull request Sep 24, 2026
…lved

PR #2276 (pgserver 0.1.4) hung for the full 180-minute job timeout on
cp312/cp313/cp314: the from-source-built initdb segfaults on riscv64 on
every invocation (not just the test whose name suggested a short-path
edge case), and the test that happened to be running when it crashed
blocks forever in multiprocessing.Queue.get() with no timeout instead of
failing fast. Recorded here for whoever picks this up next: gotcha 565
generalizes the hang-bounding fix (CIBW_TEST_REQUIRES: pytest-timeout),
gotcha 566 documents what's already ruled out on the segfault itself
(atomics detection, -march flags) and what's still needed (riscv64
hardware or working QEMU user-mode emulation, neither available in this
session) to actually root-cause it.

This branch has not been deployed

No deployments
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