Re: No libldap_r in OpenLDAP 2.5 - use LDAP_API_FEATURE_X_OPENLDAP_REENTRANT from ldap_features.h - Mailing list pgsql-bugs

From Tom Lane
Subject Re: No libldap_r in OpenLDAP 2.5 - use LDAP_API_FEATURE_X_OPENLDAP_REENTRANT from ldap_features.h
Date
Msg-id 747766.1630072057@sss.pgh.pa.us
Whole thread Raw
In response to No libldap_r in OpenLDAP 2.5 - use LDAP_API_FEATURE_X_OPENLDAP_REENTRANT from ldap_features.h  (Dilyan Palauzov <Dilyan.Palauzov@aegee.org>)
List pgsql-bugs
Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Aug 25, 2021 at 10:36:40AM -0400, Tom Lane wrote:
>> If that is your plan, then you should have only the 2.5 libldap-devel
>> support installed, not 2.4.  In particular, that would mean that you
>> shouldn't have any .so symlinks for the 2.4 libraries, which should
>> cause configure not to see them.

> Linux From Scratch puts all experience burden to the user, so they
> don't have a clear package experience AFAIK.  And I guess that the OP
> just used that:
> https://linuxfromscratch.org/blfs/view/svn/server/openldap.html
> Perhaps this documentation needs some improvement, I don't know.

Yeah, it doesn't look like that doc has any notion of development
vs. run-only installs.  Maybe the underlying packaging doesn't either.
Anyway, on better-run distros there would be such a separation.
What you'd typically find in a Linux installation of a base openldap
package is (from my RHEL8 box):

$ ls -lF /usr/lib64/libldap*
lrwxrwxrwx. 1 root root     22 Jul 11 13:46 /usr/lib64/libldap-2.4.so.2 -> libldap-2.4.so.2.10.10*
-rwxr-xr-x. 1 root root 324968 Jul 11 13:47 /usr/lib64/libldap-2.4.so.2.10.10*
lrwxrwxrwx. 1 root root     24 Jul 11 13:46 /usr/lib64/libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.10*
-rwxr-xr-x. 1 root root 349704 Jul 11 13:47 /usr/lib64/libldap_r-2.4.so.2.10.10*

while the -dev or -devel subpackage contains these versionless
symlinks:

lrwxrwxrwx. 1 root root     16 Jul 11 13:47 /usr/lib64/libldap.so -> libldap-2.4.so.2*
lrwxrwxrwx. 1 root root     18 Jul 11 13:47 /usr/lib64/libldap_r.so -> libldap_r-2.4.so.2*

along with the library' header files (in /usr/include) and maybe
some other developer-only files such as pkgconfig files.

Since the base-package library files all have versioned names,
it's possible to install base openldap packages of different
major versions without conflict.  But the versionless symlinks
*would* conflict, so a proper packaging setup would prevent
you from installing both 2.4 and 2.5 openldap-devel.

It's the versionless symlinks that will be consulted by packages
building against the library, which is why building Postgres should
work if you get rid of the 2.4-era libldap_r.so link and keep only the
2.5-era libldap.so one.  Obviously you'd better have the 2.5 include
files and so on along with that.

In short here: your problem arises because you've got inconsistent
subsets of development files in place.  I'm allergic to the proposed
behavior change in our configure script because it gets rid of one
failure mode for such inconsistent library file sets at the cost of
creating a different one (i.e. headers not consistent with libraries).
That does not seem like an improvement.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: BUG #17148: About --no-strict-names option and --quiet option of pg_amcheck command
Next
From: PG Bug reporting form
Date:
Subject: BUG #17164: Running initdb from default Administrator account results in error