Make frontend programs relink after libpgfeutils changes

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Make frontend programs relink after libpgfeutils changes
Date: 2026-06-15 07:29:01
Message-ID: 3B062561-C39C-4367-AB1E-F4C27BC6F736@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I ran into some trouble while working on patch [1], where I changed print.c and needed to rebuild psql. However, make silently didn't rebuild psql after the print.c change. I wasn’t aware of that at first, and it confused me and wasted quite a bit of time before I figured out what was happening.

I tried a Meson build. Ninja automatically rebuilds 33 client tools after print.c changes, so I changed make to automatically rebuild client tools in the same way as Meson.

But then I found that there are actually 27 client tools that depend on libpgfeutils.a. There are 6 client tools that don’t really require libpgfeutils.a, but Meson still links the library to them. They are:

* pg_archivecleanup
* pg_config
* pg_controldata
* pg_ctl
* pg_test_fsync
* pg_test_timing

I want this patch to focus on make, and I am not as familiar with Meson as I am with make, so I didn’t touch the Meson part.

With this patch, when something like print.c in libpgfeutils.a is changed, all dependent client tools are automatically rebuilt.

See the attached patch for details. BTW, besides the client tools, test_escape also depends on libpgfeutils.a, so I included it in the patch as well.

[1] https://www.postgresql.org/message-id/A44110E7-6A03-4C67-95AD-527192A6C768%40gmail.com

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v1-0001-Make-frontend-programs-relink-after-libpgfeutils-.patch application/octet-stream 14.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-06-15 07:36:32 Re: postgres_fdw: fix cumulative stats after imported foreign-table stats
Previous Message ZizhuanLiu X-MAN 2026-06-15 07:18:43 Re: Return value of XLogInsertRecord() for XLOG_SWITCH record