Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640154 - dev-libs/libpqxx-4.0.1 fails to build with dev-db/postgresql-9.6.6
Summary: dev-libs/libpqxx-4.0.1 fails to build with dev-db/postgresql-9.6.6
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-07 09:33 UTC by Andrew Petelin
Modified: 2018-05-15 20:01 UTC (History)
0 users

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


Attachments
/var/tmp/portage/dev-libs/libpqxx-4.0.1/work/libpqxx-4.0.1/config.log (config.log.bz2,7.72 KB, application/x-bzip)
2017-12-07 09:44 UTC, Andrew Petelin
Details
verbose output of `eselect postgresql set 9.6` (eselect_postgresql_set_9.6.out.bz2,1.12 KB, application/x-bzip)
2017-12-08 12:18 UTC, Andrew Petelin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Petelin 2017-12-07 09:33:30 UTC
Error:

> checking for pg_config... no
> configure: error: 
> PostgreSQL configuration script pg_config not found.  Make sure this is in your
> command path before configuring.  Without it, the configure script has no way to
> find the right location for the libpq library and its headers.

Previously there was a symlink in /usr/bin:

$ ls -l /usr/bin/pg_config
lrwxrwxrwx 1 root root 37 Jul 17 16:18 /usr/bin/pg_config -> ../lib64/postgresql-9.5/bin/pg_config

But now there is no one:

$ equery files postgresql | grep -P '\bpg_config$'
/usr/lib64/postgresql-9.6/bin/pg_config
Comment 1 Andrew Petelin 2017-12-07 09:44:39 UTC
Created attachment 508640 [details]
/var/tmp/portage/dev-libs/libpqxx-4.0.1/work/libpqxx-4.0.1/config.log
Comment 2 Aaron W. Swenson gentoo-dev 2017-12-07 16:13:27 UTC
What is the output of: eselect postgresql version
Comment 3 Andrew Petelin 2017-12-08 11:34:59 UTC
# eselect postgresql version
postgresql.eselect 2.2
eselect 1.4.8

Also, there are lots of dangling symlinks in root filesystem, most of them were created by postgresql:

# find / -xdev -xtype l | wc -l
find: ‘/usr/include/postgresql-9.6/postgresql-9.6’: Too many levels of symbolic links
323
Comment 4 Andrew Petelin 2017-12-08 11:43:25 UTC
> most of them were created by postgresql

# find / -xdev -xtype l -exec ls -l '{}' \; | grep -v postgresql
find: ‘/usr/include/postgresql-9.6/postgresql-9.6’: Too many levels of symbolic links
lrwxrwxrwx 1 root root 8 May 16  2017 /usr/bin/testrb -> testrb22
lrwxrwxrwx 1 root root 20 May 17  2017 /usr/lib32/dri/i915_dri.so -> ../mesa/i915g_dri.so
lrwxrwxrwx 1 root root 20 May 17  2017 /usr/lib64/dri/i915_dri.so -> ../mesa/i915g_dri.so
lrwxrwxrwx 1 root root 13 Dec  2 00:53 /usr/lib64/libcblas.a -> libgslcblas.a
Comment 5 Andrew Petelin 2017-12-08 11:53:48 UTC
Removed all dangling symlinks:

# find / -xdev -xtype l
/usr/lib32/dri/i915_dri.so
/usr/lib64/dri/i915_dri.so
/usr/lib64/libcblas.a

But `eselect postgresql set ...` still doesn't work:

# eselect postgresql list
Available PostgreSQL Slots
  9.6                       9.6.6
# eselect postgresql set 9.6
Setting 9.6 as the default...ln: failed to create symbolic link '/usr/include/postgresql/postgresql-9.6': File exists
!!! Error: Unable to create link! postgresql-9.6 -> /usr/include/postgresql
exiting
# ll /usr/include/postgresql/postgresql-9.6
1845487 lrwxrwxrwx 1 root root 14 Dec  8 14:47 /usr/include/postgresql/postgresql-9.6 -> postgresql-9.6

(Invalid symlink.)
Comment 6 Aaron W. Swenson gentoo-dev 2017-12-08 12:06:03 UTC
Yes, this is an artifact of a previous version of eselect. I don't know how it got there, but the 2.2 doesn't have this issue.

I'd like to have eselect fix it, but have lacked the time to deal with a broken system to find what needs to be fixed.

Is it just /usr/include that has /usr/include/postgresql-9.6/postgresql-9.6?

What about /usr/lib and /usr/share?
Comment 7 Andrew Petelin 2017-12-08 12:18:54 UTC
Created attachment 508796 [details]
verbose output of `eselect postgresql set 9.6`

> I'd like to have eselect fix it

OK, I will try to figure it out myself.

> Is it just /usr/include that has /usr/include/postgresql-9.6/postgresql-9.6?
> What about /usr/lib and /usr/share?

Yes, it is just /usr/include:

# find /usr/lib /usr/share -iname '*postgresql*'
/usr/share/postgresql-9.6
/usr/share/postgresql-9.6/postgresql.conf.sample
/usr/share/cmake/Modules/FindPostgreSQL.cmake
/usr/share/cmake/Help/module/FindPostgreSQL.rst
/usr/share/nano/postgresql.nanorc
/usr/share/eselect/modules/postgresql.eselect
/usr/share/aclocal/ax_lib_postgresql.m4
/usr/share/doc/postgresql-9.6.6
/usr/share/doc/cmake-3.8.2/html/module/FindPostgreSQL.html
/usr/share/doc/cmake-3.8.2/html/_sources/module/FindPostgreSQL.rst.txt
/usr/share/doc/redland-1.0.16/html/redland/redland-storage-module-postgresql.html
Comment 8 Aaron W. Swenson gentoo-dev 2017-12-08 15:07:07 UTC
(In reply to Andrew Petelin from comment #7)
> Created attachment 508796 [details]
> verbose output of `eselect postgresql set 9.6`
> 
> > I'd like to have eselect fix it
> 
> OK, I will try to figure it out myself.
> 
> > Is it just /usr/include that has /usr/include/postgresql-9.6/postgresql-9.6?
> > What about /usr/lib and /usr/share?
> 
> Yes, it is just /usr/include:
> 
> # find /usr/lib /usr/share -iname '*postgresql*'
> /usr/share/postgresql-9.6
> /usr/share/postgresql-9.6/postgresql.conf.sample
> /usr/share/cmake/Modules/FindPostgreSQL.cmake
> /usr/share/cmake/Help/module/FindPostgreSQL.rst
> /usr/share/nano/postgresql.nanorc
> /usr/share/eselect/modules/postgresql.eselect
> /usr/share/aclocal/ax_lib_postgresql.m4
> /usr/share/doc/postgresql-9.6.6
> /usr/share/doc/cmake-3.8.2/html/module/FindPostgreSQL.html
> /usr/share/doc/cmake-3.8.2/html/_sources/module/FindPostgreSQL.rst.txt
> /usr/share/doc/redland-1.0.16/html/redland/redland-storage-module-postgresql.
> html

Great, thanks!

One more thing:
# ls -ashl /usr/include/postgresql-9.6
Comment 9 Andrew Petelin 2017-12-08 15:10:46 UTC
# ls -ashlF /usr/include/postgresql-9.6
total 204K
4.0K drwxr-xr-x   6 root root 4.0K Dec  8 15:00 ./
 40K drwxr-xr-x 454 root root  36K Dec  8 14:44 ../
4.0K -rw-r--r--   1 root root  714 Dec  8 14:47 ecpg_config.h
4.0K -rw-r--r--   1 root root 2.5K Dec  8 14:47 ecpgerrno.h
4.0K -rw-r--r--   1 root root 2.7K Dec  8 14:47 ecpg_informix.h
4.0K -rw-r--r--   1 root root 2.6K Dec  8 14:47 ecpglib.h
4.0K -rw-r--r--   1 root root 2.6K Dec  8 14:47 ecpgtype.h
4.0K drwxr-xr-x   3 root root 4.0K Jul 17 16:18 informix/
4.0K drwxr-xr-x   3 root root 4.0K Dec  8 14:47 internal/
4.0K drwxr-xr-x   2 root root 4.0K Dec  8 14:47 libpq/
4.0K -rw-r--r--   1 root root 2.2K Dec  8 14:47 libpq-events.h
 24K -rw-r--r--   1 root root  22K Dec  8 14:47 libpq-fe.h
4.0K -rw-r--r--   1 root root  323 Dec  8 14:47 pg_config_ext.h
 32K -rw-r--r--   1 root root  29K Dec  8 14:47 pg_config.h
 12K -rw-r--r--   1 root root  12K Dec  8 14:47 pg_config_manual.h
4.0K -rw-r--r--   1 root root 1.1K Dec  8 14:47 pg_config_os.h
4.0K -rw-r--r--   1 root root  766 Dec  8 14:47 pgtypes_date.h
4.0K -rw-r--r--   1 root root  530 Dec  8 14:47 pgtypes_error.h
4.0K -rw-r--r--   1 root root 1.2K Dec  8 14:47 pgtypes_interval.h
4.0K -rw-r--r--   1 root root 2.2K Dec  8 14:47 pgtypes_numeric.h
4.0K -rw-r--r--   1 root root 1010 Dec  8 14:47 pgtypes_timestamp.h
4.0K -rw-r--r--   1 root root 2.2K Dec  8 14:47 postgres_ext.h
4.0K drwxr-xr-x  28 root root 4.0K Dec  8 14:47 server/
4.0K -rw-r--r--   1 root root  834 Dec  8 14:47 sql3types.h
4.0K -rw-r--r--   1 root root 1.3K Dec  8 14:47 sqlca.h
4.0K -rw-r--r--   1 root root 1.6K Dec  8 14:47 sqlda-compat.h
4.0K -rw-r--r--   1 root root  317 Dec  8 14:47 sqlda.h
4.0K -rw-r--r--   1 root root  820 Dec  8 14:47 sqlda-native.h
Comment 10 Aaron W. Swenson gentoo-dev 2017-12-08 15:29:33 UTC
(In reply to Andrew Petelin from comment #9)
> # ls -ashlF /usr/include/postgresql-9.6
> total 204K
> ...

Huh. That is not what I expected.

# for l in $(find /usr/include/ -maxdepth 1 -type l -name 'postgresql*') ; do echo "$l -> $(realpath $l)"; done

# for l in $(find /usr/include/postgresql/ -maxdepth 1 -type l) ; do echo "$l -> $(realpath $l)"; done
Comment 11 Andrew Petelin 2017-12-08 15:36:26 UTC
# for l in $(find /usr/include/ -maxdepth 1 -type l -name 'postgresql*') ; do echo "$l -> $(realpath $l)"; done
/usr/include/postgresql -> /usr/include/postgresql-9.6
# for l in $(find /usr/include/postgresql/ -maxdepth 1 -type l) ; do echo "$l -> $(realpath $l)"; done
#
Comment 12 Aaron W. Swenson gentoo-dev 2017-12-08 19:15:23 UTC
Okay, you should only need to remove the offending symlink:

# rm /usr/include/postgresql/postgresql-9.6

Then recreate a link (the eselect module looks to see if this is set):

# ln -s postgresql-9.5 /usr/share/postgresql

Then you can let eselect do its thing:

# eselect postgresql set 9.6
Comment 13 Larry the Git Cow gentoo-dev 2018-01-14 18:25:42 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fb5707e09234326c4fd71ddc0b6b34d66775968

commit 9fb5707e09234326c4fd71ddc0b6b34d66775968
Author:     Aaron W. Swenson <titanofold@gentoo.org>
AuthorDate: 2018-01-14 18:25:05 +0000
Commit:     Aaron W. Swenson <titanofold@gentoo.org>
CommitDate: 2018-01-14 18:25:33 +0000

    app-eselect/eselect-postgresql: Bump to 2.3
    
    ln now tries to force the link (Thanks Matthew Thode [prometheanfire])
    
    Cleans up nonsensical links in /usr/include/postgresql-* that were
    made by some previous versions of this module.
    
    Bug: https://bugs.gentoo.org/627476
    Bug: https://bugs.gentoo.org/631936
    Bug: https://bugs.gentoo.org/640154
    Bug: https://bugs.gentoo.org/640394
    Package-Manager: Portage-2.3.13, Repoman-2.3.3

 app-eselect/eselect-postgresql/Manifest            |  1 +
 .../eselect-postgresql-2.3.ebuild                  | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)}
Comment 14 Larry the Git Cow gentoo-dev 2018-05-15 20:01:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=847228fc6fdbde73141282081e5eca15a025ad90

commit 847228fc6fdbde73141282081e5eca15a025ad90
Author:     Aaron W. Swenson <titanofold@gentoo.org>
AuthorDate: 2018-05-15 20:01:00 +0000
Commit:     Aaron W. Swenson <titanofold@gentoo.org>
CommitDate: 2018-05-15 20:01:00 +0000

    dev-libs/libpqxx: Cleanup
    
    Closes: https://bugs.gentoo.org/642434
    Closes: https://bugs.gentoo.org/640154
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 dev-libs/libpqxx/Manifest             |  3 --
 dev-libs/libpqxx/libpqxx-4.0.1.ebuild | 84 ----------------------------------
 dev-libs/libpqxx/libpqxx-5.1.0.ebuild | 86 -----------------------------------
 dev-libs/libpqxx/libpqxx-5.1.1.ebuild | 86 -----------------------------------
 4 files changed, 259 deletions(-)