Re: Can't compile PG 17 (master) from git under Msys2 autoconf - Mailing list pgsql-hackers

From 'Alvaro Herrera'
Subject Re: Can't compile PG 17 (master) from git under Msys2 autoconf
Date
Msg-id 202404051810.et6ufj5snhmt@alvherre.pgsql
Whole thread Raw
In response to RE: Can't compile PG 17 (master) from git under Msys2 autoconf  ("Regina Obe" <lr@pcorp.us>)
Responses RE: Can't compile PG 17 (master) from git under Msys2 autoconf
List pgsql-hackers
On 2024-Apr-05, Regina Obe wrote:

> 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/



pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed