doing something about the broken dynloader.h symlink

Started by Peter Eisentrautover 5 years ago6 messages
#1Peter Eisentraut
peter.eisentraut@2ndquadrant.com

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

#2Thomas Munro
thomas.munro@gmail.com
In reply to: Peter Eisentraut (#1)
Re: doing something about the broken dynloader.h symlink

On Fri, Jun 19, 2020 at 8:02 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:

+[# Remove links created by old versions of configure, so that there
+# are no broken symlinks in the tree
+rm -f src/include/dynloader.h])

+1

#3Michael Paquier
michael@paquier.xyz
In reply to: Thomas Munro (#2)
Re: doing something about the broken dynloader.h symlink

On Fri, Jun 19, 2020 at 10:08:05PM +1200, Thomas Munro wrote:

On Fri, Jun 19, 2020 at 8:02 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:

+[# Remove links created by old versions of configure, so that there
+# are no broken symlinks in the tree
+rm -f src/include/dynloader.h])

+1

Not sure about your suggested patch, but +1 for doing something.
--
Michael

#4Julien Rouhaud
rjuju123@gmail.com
In reply to: Thomas Munro (#2)
Re: doing something about the broken dynloader.h symlink

On Fri, Jun 19, 2020 at 12:08 PM Thomas Munro <thomas.munro@gmail.com> wrote:

On Fri, Jun 19, 2020 at 8:02 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:

+[# Remove links created by old versions of configure, so that there
+# are no broken symlinks in the tree
+rm -f src/include/dynloader.h])

+1

+1

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: doing something about the broken dynloader.h symlink

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:

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

While I don't necessarily object to the hack you propose here, it seems
to me that really we need to caution people more strongly about not just
cavalierly checking out a different branch in the same build directory
without fully cleaning up built files (that is, "git clean -dfx" or the
like). There are other gotchas that that creates, and I don't want to
establish a precedent that it's our job to work around them.

regards, tom lane

#6Thomas Munro
thomas.munro@gmail.com
In reply to: Julien Rouhaud (#4)
Re: doing something about the broken dynloader.h symlink

On Fri, Jun 19, 2020 at 11:38 PM Julien Rouhaud <rjuju123@gmail.com> wrote:

On Fri, Jun 19, 2020 at 12:08 PM Thomas Munro <thomas.munro@gmail.com> wrote:

On Fri, Jun 19, 2020 at 8:02 PM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:

+[# Remove links created by old versions of configure, so that there
+# are no broken symlinks in the tree
+rm -f src/include/dynloader.h])

+1

+1

+1