Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name
Date
Msg-id 3529036.1657927332@sss.pgh.pa.us
Whole thread Raw
In response to Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name  (Andres Freund <andres@anarazel.de>)
Responses Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name
List pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2022-07-15 20:38:17 +0200, Alvaro Herrera wrote:
>> Right.  See commit 984b0b4df83f and its discussion at [1].  The working
>> theory (as I remember it) is that if the installation is already
>> postgres-specific (because the user has made it so by having "pgsql" or
>> "postgres" in the argument to --prefix), then we don't need to add
>> another level of postgres-specificity to it; but otherwise we add
>> "/postgresql" to the path so that the resulting files don't end up mixed
>> with files installed by unrelated packages.

> I think the current approach isn't great.

> E.g., putting extension .so's into the same directories as "normal shared
> libraries", which typically is either in the library search path via system
> configuration, or in the library search path due to rpath, strikes me as quite
> wrongheaded.

Well, we don't, with a normal not-PG-specific install path.
What I get with --prefix=/home/tgl/testversion is

$ ls ~/testversion/lib
libecpg.a         libecpg_compat.so@      libpgtypes.so@      libpq.so.5@
libecpg.so@       libecpg_compat.so.3@    libpgtypes.so.3@    libpq.so.5.5*
libecpg.so.6@     libecpg_compat.so.3.4*  libpgtypes.so.3.3*  postgresql/
libecpg.so.6.4*   libpgport.a             libpq.a
libecpg_compat.a  libpgtypes.a            libpq.so@

$ ls ~/testversion/lib/postgresql
ascii_and_mic.so*       pgxs/                  utf8_and_gb18030.so*
cyrillic_and_mic.so*    plperl.so*             utf8_and_gbk.so*
dict_snowball.so*       plpgsql.so*            utf8_and_iso8859.so*
euc2004_sjis2004.so*    utf8_and_ascii.so*     utf8_and_iso8859_1.so*
euc_cn_and_mic.so*      utf8_and_big5.so*      utf8_and_johab.so*
euc_jp_and_sjis.so*     utf8_and_cyrillic.so*  utf8_and_sjis.so*
euc_kr_and_mic.so*      utf8_and_euc2004.so*   utf8_and_sjis2004.so*
euc_tw_and_big5.so*     utf8_and_euc_cn.so*    utf8_and_uhc.so*
latin2_and_win1250.so*  utf8_and_euc_jp.so*    utf8_and_win.so*
latin_and_mic.so*       utf8_and_euc_kr.so*
libpqwalreceiver.so*    utf8_and_euc_tw.so*

which seems perfectly sane from here.  The issue is that if the
install directory path already has "postgres" somewhere in it,
you get a different layout where the PG-specific subdir is smashed
together with the user libraries.

I tend to agree with the OP that that case isn't great, but we've
had it like this for so long that I'm not sure we can change it.
OTOH, the issue probably only affects PG developers, so maybe
we could?

> Nor do we really allow the user to opt in/out of us changing the
> user-specified install locations.

Yeah, you'd have to resort to editing Makefile.global after
configuring, which is annoying.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: Excessive number of replication slots for 12->14 logical replication
Next
From: Andres Freund
Date:
Subject: Re: Makefile.global will override configure parameters if "pgsql" and "postgres" appear anywhere in the source path name