zic: fix PostgreSQL build failure on filesystems without hard link support

From: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: zic: fix PostgreSQL build failure on filesystems without hard link support
Date: 2026-07-30 12:31:31
Message-ID: e6122f9b2eef9096f1f11ecc058bcd91@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Problem:

PostgreSQL fails to build on filesystems that do not support hard links
(e.g., exFAT, FAT32, some network filesystems). The build process stops
with the following error during timezone data generation:

Can't link <target> to <linkname>: Invalid argument

This regression was introduced by commit
aeb07c55fab5c17a600b77ffcdc3b71425d6a8e7
("Sync our copy of the timezone library with IANA release tzcode2026b"),
which updated zic to a new version from upstream tzcode. The previous
version of zic worked correctly on such filesystems by falling back to
copying files when hard links were not supported.

The issue affects users building PostgreSQL on Windows using exFAT-
formatted drives, as well as other platforms where the build directory
resides on filesystems lacking hard link support.

Root Cause Analysis:

In the new dolink() function introduced by the upstream update, the
error
handling logic for hard link creation only treats EXDEV and ENOTSUP as
recoverable errors:

if (link_errno == EXDEV || link_errno == ENOTSUP)
break; /* proceed to fallback */

All other errno values are considered fatal and cause zic to abort.

However, the link() system call returns EINVAL on filesystems that do
not
support hard links (including exFAT, FAT32, and some network
filesystems).
Since EINVAL is not handled as a recoverable error, the new zic fails
where the old one succeeded.

Solution:

Proposed patch adds EINVAL to the list of errno values that
trigger the fallback path (symbolic link or file copy),
restoring the pre-2026b behavior.

Testing:

- Verified on exFAT partition: zic successfully completes without
errors.
- Verified on NTFS and ext4: no regression, hard links work as expected.

--
Best regards,

Vladlen Popolitov.

Attachment Content-Type Size
0001-zic-fix-PostgreSQL-build-failure-on-filesystems-with.patch text/x-diff 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2026-07-30 12:41:26 Re: Fix hashchar() and hashcharextended() to not depend on char signedness
Previous Message Ashutosh Bapat 2026-07-30 12:21:29 Re: [PATCH] Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL