doing something about the broken dynloader.h symlink

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: doing something about the broken dynloader.h symlink
Date: 2020-06-19 08:02:04
Message-ID: 98c912de-4333-9e02-e1b5-b38462159101@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When you switch a built REL_11_STABLE or earlier to REL_12_STABLE or
later, you get during make install (or, therefore, make check) an error

cp ./*.h 'PREFIX/include/server'/
cp: cannot stat './dynloader.h': No such file or directory

This is because version 11 and earlier created src/include/dynloader.h
as a symlink during configure, but this was changed in version 12, and
the target that the symlink points to is no longer there in that branch.

This has been known for some time, and I figured the issue would go
away, but people keep complaining to me, so maybe a simple fix could be
applied.

Even if it's quite late to fix this, it's perhaps worth establishing a
principled solution, in case we ever change any of the other symlinks
currently created by configure.

It is worth noting that half the problem is that the cp command uses
wildcards, where in a puristic situation all the files would be listed
explicitly and any extra files left around would not pose problems.
However, it seems generally bad to leave broken symlinks lying around,
since that can also trip up other tools.

My proposed fix is to apply this patch:

diff --git a/configure.in b/configure.in
index 7d63eb2fa3..84221690e0 100644
--- a/configure.in
+++ b/configure.in
@@ -2474,7 +2474,10 @@ AC_CONFIG_LINKS([
src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}
src/include/pg_config_os.h:src/include/port/${template}.h
src/Makefile.port:src/makefiles/Makefile.${template}
-])
+], [],
+[# Remove links created by old versions of configure, so that there
+# are no broken symlinks in the tree
+rm -f src/include/dynloader.h])

if test "$PORTNAME" = "win32"; then
AC_CONFIG_COMMANDS([check_win32_symlinks],[

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-06-19 08:09:46 Re: More tzdb fun: POSIXRULES is being deprecated upstream
Previous Message Kyotaro Horiguchi 2020-06-19 07:43:04 Re: min_safe_lsn column in pg_replication_slots view