ci: namespace ccache by PostgreSQL major version

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>
Subject: ci: namespace ccache by PostgreSQL major version
Date: 2026-07-03 14:26:30
Message-ID: CAN55FZ0tqR6Xz=iVFLc1BBoLOEHU775ARhcGYwggHA3XLA=oQg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

When the Postgres major version is updated, CI fails with [1]:

2026-07-02 17:01:01.938 UTC [828] FATAL: incompatible library
"D:/a/postgresql/postgresql/build/tmp_install/usr/local/pgsql/lib/utf8_and_win.dll":
version mismatch
2026-07-02 17:01:01.938 UTC [828] DETAIL: Server is version 20,
library is version 19.

This happens because the GitHub Actions ccache is restored across a
version bump, so objects built against the previous version can be
reused, producing libraries that no longer match the server version.

Here is an attempt to solve this problem by namespacing ccache by
Postgres major version. I added a 'PG_MAJOR_VERSION' variable to the
CI file and used that as a prefix to ccache key. I made this
'PG_MAJOR_VERSION' variable automatically updated by
'version_stamp.pl' script.

Another solution could be reading the version from build files (e.g
meson.build), but then this read needs to be done at each CI run.

[1] https://github.com/postgresql-cfbot/postgresql/actions/runs/28606913807/job/84829900634

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v1-0001-ci-namespace-ccache-by-PostgreSQL-major-version.patch text/x-patch 3.0 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-07-03 14:45:54 Re: [Bug][patch]: After dropping the last label from a property graph element, invoking pg_get_propgraphdef() triggers an assertion failure
Previous Message Ewan Young 2026-07-03 14:20:42 Re: REPACK CONCURRENTLY fails on tables with generated columns