RE: Can't compile PG 17 (master) from git under Msys2 autoconf

From: "Regina Obe" <lr(at)pcorp(dot)us>
To: "'Alvaro Herrera'" <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "'Postgres hackers'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Can't compile PG 17 (master) from git under Msys2 autoconf
Date: 2024-04-05 22:41:15
Message-ID: 001f01da87aa$5eac9650$1c05c2f0$@pcorp.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > I think it ends up doing a copy thus the copy error in my log failures
> > which don't exist anywhere in the Makefil
> >
> > cp -pR ../../backend/storage/lmgr/lwlocknames.h
> >
> > Sorry for not checking on a linux system. I was thinking I should have done
> that first.
>
> Ah yeah, that's per configure:
>
> if ln -s conf$$.file conf$$ 2>/dev/null; then
> as_ln_s='ln -s'
> # ... but there are two gotchas:
> # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
> # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
> # In both cases, we have to default to `cp -pR'.
> ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
> as_ln_s='cp -pR'
>
> I guess we need to patch the rule so that the LN_S is called so that it'd resolve
> correctly in both cases. I guess the easy option is to go back to the original
> recipe and update the comment to indicate that we do it to placate Msys2.
> Here it is with the old comment:
>
> -# The point of the prereqdir incantation in some of the rules below is to
> -# force the symlink to use an absolute path rather than a relative path.
> -# For headers which are generated by make distprep, the actual header
> within
> -# src/backend will be in the source tree, while the symlink in src/include
> -# will be in the build tree, so a simple ../.. reference won't work.
> -# For headers generated during regular builds, we prefer a relative symlink.
>
> $(top_builddir)/src/include/storage/lwlocknames.h:
> storage/lmgr/lwlocknames.h
> - prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \
> - cd '$(dir $@)' && rm -f $(notdir $@) && \
> - $(LN_S) "$$prereqdir/$(notdir $<)" .
>
>
> Maybe it's possible to make this simpler, as it looks overly baroque, and we
> don't really need absolute paths anyway -- we just need the path resolved at
> the right time.
>
> --
> Álvaro Herrera Breisgau, Deutschland —
> https://www.EnterpriseDB.com/

Yah I was thinking it was removed cause
no one could figure out why it was so complicated and decided to make it more readable.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-04-05 23:08:14 Re: Popcount optimization using AVX512
Previous Message Daniel Gustafsson 2024-04-05 22:31:57 Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?