Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 299796 - Make postgresql compatible with multilib-native
Summary: Make postgresql compatible with multilib-native
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
: 589340 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-05 18:11 UTC by Bernhard Frauendienst
Modified: 2016-08-01 11:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for postgresql-{base,server}-8.4.2 for multilib-native compatibility (postgresql-multilib-compat.diff,4.95 KB, patch)
2010-01-05 18:12 UTC, Bernhard Frauendienst
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Frauendienst 2010-01-05 18:11:07 UTC
The following is a suggestion for how to make postgresql compatible with possible future native multilib solutions. I will first outline the problem at hand, and then provide a simple and in my opinion decent solution.

The problem: the way the current multilib-native approach works is to compile the package for different ABIs, put libraries in their respective directories and wrap binaries with a abi-wrapper that chooses the right version at runtime. It thus relies on src_install to install binaries for different ABIs in the same place.
However, this doesn't work with current postgresql installations, because in order to work with eselect-postgresql, they have their binaries installed in /usr/$(get_libdir)/postgresql-${SLOT}/bin.
Since this path is obviously ABI-dependant, the abi-wrapper does not work.

The solution: after some consideration, I've found a solution that is easy to implement, requires no changes to eselect-postgresql whatsoever and also does not affect users in any way (except when they have /usr/$(get_libdir)/postgresl-${SLOT}/bin hardcoded somewhere, which would then be their own fault, really).
The solution is to simply install the binaries to /usr/libexec/postgresql-${SLOT}, which is a nicer place for binaries to reside than /usr/lib anyway, in my opinion.
Attached is a patch for postgresql-{base,server}-8.4.2 to demonstrate the solution. I have tested them on my system and so far encountered no obvious problems.

Any comments would be highly appreciated. Thanks.
Comment 1 Bernhard Frauendienst 2010-01-05 18:12:17 UTC
Created attachment 215321 [details, diff]
patch for postgresql-{base,server}-8.4.2 for multilib-native compatibility
Comment 2 Bernhard Frauendienst 2010-01-06 00:45:30 UTC
Something I should probably add: the main reason why we actually need 32bit binaries for postgres is that most build systems and ebuilds depending on postgresql use pg_config --libdir to find the postgresql libraries.
If this binary only exists as 64bit, 32bit applications will try to link against 64bit pgsql libs, which of course fails.


PS: Apologies for CC'ing the postgresql herd, I was told (too late) that I shouldn't have done this. Won't happen again ;)
Comment 3 Patrick Lauer gentoo-dev 2010-06-16 19:01:14 UTC
Good idea. native-multilib is still a good while away, so there's nothing we can do now. Reopen if it ever becomes a real issue :)
Comment 4 Aaron W. Swenson gentoo-dev 2014-01-14 16:49:14 UTC
Comment on attachment 215321 [details, diff]
patch for postgresql-{base,server}-8.4.2 for multilib-native compatibility

Unfortunately, this solution will not work. libexec is reserved for executables that are not meant to be directly invoked by the user or a script.

The eselect module is now a bit more sophisticated and can handle multilib, in theory.

I will consider this if there is someone that can provide an example of some program that will not work with PostgreSQL, and if there is sufficient demand.

Otherwise, I lack the interest in supporting such a setup as I am on 64-bit no-multilib.
Comment 5 Aaron W. Swenson gentoo-dev 2016-08-01 11:35:22 UTC
*** Bug 589340 has been marked as a duplicate of this bug. ***