Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528786 - dev-db/postgis-2.1.4 - make[2]: /var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/install: Command not found
Summary: dev-db/postgis-2.1.4 - make[2]: /var/tmp/portage/._portage_reinstall_.JeajSm/...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-10 06:08 UTC by Thomas Beutin
Modified: 2015-12-18 11:16 UTC (History)
5 users (show)

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


Attachments
build.log (build.log,108.92 KB, text/plain)
2014-11-10 06:09 UTC, Thomas Beutin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Beutin 2014-11-10 06:08:51 UTC
make -f Makefile.comments install
make[2]: Entering directory '/var/tmp/portage/dev-db/postgis-2.1.4/work/postgis-2.1.4/doc'
/bin/mkdir -p '/var/tmp/portage/dev-db/postgis-2.1.4/image//usr/share/postgresql-9.3/contrib/postgis-2.1'
/var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/install -c -m 644  postgis_comments.sql raster_comments.sql topology_comments.sql '/var/tmp/portage/dev-db/postgis-2.1.4/image//usr/share/postgresql-9.3/contrib/postgis-2.1/'
make[2]: /var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/install: Command not found
/usr/lib64/postgresql-9.3/lib64/pgxs/src/makefiles/pgxs.mk:120: recipe for target 'install' failed
make[2]: *** [install] Error 127
make[2]: Leaving directory '/var/tmp/portage/dev-db/postgis-2.1.4/work/postgis-2.1.4/doc'
Makefile:311: recipe for target 'comments-install' failed
make[1]: *** [comments-install] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-db/postgis-2.1.4/work/postgis-2.1.4/doc'
GNUmakefile:97: recipe for target 'comments-install' failed
make: *** [comments-install] Error 2

(full build.log will be attached)

Reproducible: Always




# emerge --info =dev-db/postgis-2.1.4
Portage 2.2.8-r2 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.19-r1, 3.14.14-gentoo x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.14.14-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E31220_@_3.10GHz-with-gentoo-2.2
KiB Mem:    32965900 total,    401424 free
KiB Swap:   16776116 total,  11556716 free
Timestamp of tree: Mon, 10 Nov 2014 00:30:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.7, 3.2.5-r6, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.7.3-r1, 4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo sunrise science barzog-overlay x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA @FREE Intel-SDP"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7-avx -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=corei7-avx -fomit-frame-pointer -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /var/lib/layman/science /var/lib/layman/barzog-overlay /usr/local/portage"
USE="X509 aac aacplus aalib accounting acl adns aim amd64 ansi apache2 audit automount autotrace bacula-console bash-completion bcmath bidi bind-mysql bittorrent bzip2 cairo calendar caps ccache cdb cgi chipcard chroot command-args corefonts cpudetection cpulimit cracklib cramfs crypt cscope css csv ctype curl curlwrappers customlog cvsgraph cxx cyrus dba dbi dbm dbx device-mapper devmap dhcp djvu dlopen dnsdb ecc emf encode enscript exif expat fam fastcgi ffmpeg fftw fits flac flash flatfile fontconfig fpm fpx ftp gd gdal gdbm geoip geos gif gmp graphviz gs gssapi gzip hardened hardenedphp hdf5 hdri hpn http i18n iconv icq icu idea idled idn imagemagick imap imlib imlib2 inifile innodb ipalias ipv6 jabber jbig jpeg jpeg2k json lapack lcms ldap less libwww lm_sensors lmtp logrotate logwatch lzma lzo mbox mcal memlimit mgetty mhash milter mime mimencode ming mmap mmx mp3 mpeg mpm-prefork mppe-mppc multilib mysql mysqli nagios-dns nagios-game nagios-ntp nagios-ping nagios-ssh ncurses netboot netcdf netifrc network nfs nis nls nntp nptl nptlonly oav odbc ogg oggvorbis opencl openexr openmp openrc openssh openssl pam pam_chroot pam_timestamp pango parse-clocks pcntl pcre pdf pdfkit pdflib perl php pic plotutils png posix postfix postgis postgres postscript procmail proj pwdb python qdbm qemu quotas radius raw readline recode reiserfs rmtp rrdtool rss sample sasl screen sendfile sensord session sftp sftplogging shaper shared sharedext sieve simplexml slang slp smartcard smime smp sms smtp snmp snortsam soap sockets socks5 spamassassin spell spl sql sqlite sqlite3 sse sse2 sse3 sse4 sse4_1 ssl ssse3 stream subversion svg sysfs syslog sysvipc szip tcpd theora tidy tiff tls tokenizer transparent-proxy truetype truetype-fonts type1-fonts udev unicode userlocales utf8 uuid vhosts vim-syntax virtual-users virus-scan vorbis vpx wddx webp withsamplescripts wmf x264 xattr xfs xinetd xls xml xml2 xmlrpc xpm xsl xslt xvid yahoo yaz zlib" ABI_X86="64" APACHE2_MODULES="access auth auth_basic authn_dbm dbd ident imagemap authn_dbd authn_file authn_default authz_groupfile authn_alias authn_anon authz_dbm authz_owner authz_default authz_user auth_digest authz_host alias file_cache echo charset_lite cache disk_cache mem_cache ext_filter case_filter case-filter-in deflate filter mime_magic cern_meta proxy_ajp proxy_balancer expires headers usertrack proxy proxy_connect proxy_ftp proxy_http info include cgi cgid dav dav_lock dav_fs vhost_alias speling rewrite log_config logio env setenvif mime status substitute autoindex asis negotiation dir imap actions userdir so unique_id" APACHE2_MPMS="prefork" CURL_SSL="openssl" ELIBC="glibc" FFTOOLS="cws2fws qt-faststart aviocat ismindex" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LINGUAS="en" PHP_TARGETS="php5-4 php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" USERLAND="GNU" VIDEO_CARDS="vga"
USE_PYTHON="2.7 3.2 3.3"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC
Comment 1 Thomas Beutin 2014-11-10 06:09:44 UTC
Created attachment 388984 [details]
build.log
Comment 2 Zac Medico gentoo-dev 2014-11-10 08:26:21 UTC
This appears to be a defect of postgresql-server, since it has hardcoded the path to 'install' inside /usr/lib64/postgresql-9.3/lib64/pgxs/src/makefiles/pgxs.mk. Instead, it should use PATH to locate the 'install' binary.
Comment 3 Aaron W. Swenson gentoo-dev 2014-11-11 00:16:10 UTC
So far I'm unable to reproduce this issue.

I don't see where install is hardcoded. The only hard coded path I see will never be referenced as VPATH is disabled. I only see references to install-sh relative to the location of pgxs.mk.

However, the same line that's giving the reporter issue is calling '/usr/bin/install' on my system instead of '/var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/install'
Comment 4 Aaron W. Swenson gentoo-dev 2014-11-11 16:03:01 UTC
(In reply to Thomas Beutin from comment #0)
> make -f Makefile.comments install
> make[2]: Entering directory
> '/var/tmp/portage/dev-db/postgis-2.1.4/work/postgis-2.1.4/doc'
> /bin/mkdir -p
> '/var/tmp/portage/dev-db/postgis-2.1.4/image//usr/share/postgresql-9.3/
> contrib/postgis-2.1'
> /var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/
> install -c -m 644  postgis_comments.sql raster_comments.sql

How about reemerging Portage with xattr disabled?

USE=-xattr emerge portage
Comment 5 Thomas Beutin 2014-11-12 00:57:11 UTC
(In reply to Aaron W. Swenson from comment #4)
> (In reply to Thomas Beutin from comment #0)
[...]
> How about reemerging Portage with xattr disabled?
> 
> USE=-xattr emerge portage

USE="-xattr" emerge -1 sys-apps/portage && emerge -1 dev-db/postgis::gentoo

results in the same error.

maybe this is helpful: the suggested ebuild of bug 520694 comment 3 worked for me once, but not anymore.
Comment 6 Aaron W. Swenson gentoo-dev 2014-11-13 14:06:52 UTC
(In reply to Thomas Beutin from comment #5)
> (In reply to Aaron W. Swenson from comment #4)
> > (In reply to Thomas Beutin from comment #0)
> [...]
> > How about reemerging Portage with xattr disabled?
> > 
> > USE=-xattr emerge portage
> 
> USE="-xattr" emerge -1 sys-apps/portage && emerge -1 dev-db/postgis::gentoo
> 
> results in the same error.
> 
> maybe this is helpful: the suggested ebuild of bug 520694 comment 3 worked
> for me once, but not anymore.

There's nothing significantly different with that ebuild from the one in the tree.

Adding dev-portage back on to hopefully get a bit more insight here.
Comment 7 Zac Medico gentoo-dev 2014-11-13 18:07:29 UTC
(In reply to Aaron W. Swenson from comment #3)
> So far I'm unable to reproduce this issue.
> 
> I don't see where install is hardcoded. The only hard coded path I see will
> never be referenced as VPATH is disabled. I only see references to
> install-sh relative to the location of pgxs.mk.
> 
> However, the same line that's giving the reporter issue is calling
> '/usr/bin/install' on my system instead of
> '/var/tmp/portage/._portage_reinstall_.JeajSm/bin/ebuild-helpers/xattr/
> install'

It's calling /usr/bin/install because postgresql-server was installed with FEATURES=xattr disabled. If you re-install postgresql-server with FEATURES=xattr enabled, then it's going to use portage's install wrapper, which is bad.
Comment 8 Chris Mayo 2014-12-20 16:51:49 UTC
For me it's re-emerging postgresql-base that fixes it.

Is it relevant that the last postgresql-base emerge was before portage went from 2.2.8-r2 to 2.2.14?
Comment 9 Zac Medico gentoo-dev 2014-12-20 17:25:02 UTC
(In reply to Chris Mayo from comment #8)
> For me it's re-emerging postgresql-base that fixes it.

Okay, then it's postgresql-base that hardcodes the install path in /usr/lib64/postgresql-9.3/lib64/pgxs/src/makefiles/pgxs.mk.

> Is it relevant that the last postgresql-base emerge was before portage went
> from 2.2.8-r2 to 2.2.14?

It's not relevant, because any recent all recent versions of portage do the _portage_reinstall_ thing when upgrading themselves. You will not notice breakage from the hardcoded install path in pgxs.mk unless you happen to have portage and postgresql-base upgraded by the same emerge invocation.
Comment 10 Mira Ressel 2015-07-27 12:01:48 UTC
Ping. This isn't fixed yet, installing postgresql with FEATURES=-xattr is just a workaround.

I also hit this issue today after an transition from python3.3 to python3.4, because /usr/lib64/postgresql-9.4/lib64/pgxs/src/Makefile.global was still referencing the python3.3 version of the install wrapper.
Comment 11 Kalin KOZHUHAROV 2015-09-07 07:51:24 UTC
I spend some "fun" time hunting around this today...

Finally found this bug and after `emerge =dev-db/postgresql-9.4.4` after portage with USE=xattr, I can emerge postgis (2.1.8, but I guess 2.1.1 would work too).

My previous build of postgresql indeed captured the wrong path in /usr/lib64/postgresql-9.4/lib64/pgxs/src/Makefile.global


Just an assumption, but this happened during `emerge -evtq @world` initially, so maybe it occurs only if portage and postgresql are emerged in one go with USE=xattr

May that be a corner case of bug #547086 workaround? If so it should go under sys-apps/portage...
Comment 12 Kalin KOZHUHAROV 2015-09-07 08:04:42 UTC
Well, I decided to test my assumption, it seems I was partially right.


:: Steps to reproduce:
1. `USE=xattr emerge portage dev-db/postgresql postgis`

... 

make[2]: Entering directory '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'
/bin/mkdir -p '/var/tmp/portage/dev-db/postgis-2.1.8/image//usr/share/postgresql-9.4/contrib/postgis-2.1'
/var/tmp/portage/._portage_reinstall_.8tjeeiyk/bin/ebuild-helpers/xattr/install -c -m 644 postgis_comments.sql raster_comments.sql topology_comments.sql '/var/tmp/portage/dev-db/postgis-2.1.8/image//usr/share/postgresql-9.4/contrib/postgis-2.1/'
make[2]: Leaving directory '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'
make[1]: Leaving directory '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'

...

2. USE=xattr emerge postgis

What happens:
 postgresql wrongly records path, so next emerge postgis fails!

# fgrep _portage_reinstall_ /usr/lib64/postgresql-9.4/lib64/pgxs/src/Makefile.global 
install_bin = /var/tmp/portage/._portage_reinstall_.8tjeeiyk/bin/ebuild-helpers/xattr/install -c

:: Fix
 something should be done in postgresql or portage, not postgis

:: Workaround
 `emerge postgresql postgis`

I wonder if there are other packages failing in this way with >=sys-apps/portage-2.2.19 ??
If so, reopening bug #547086 is in order.
Comment 13 Aaron W. Swenson gentoo-dev 2015-12-14 22:45:09 UTC
(In reply to Kalin KOZHUHAROV from comment #12)
> Well, I decided to test my assumption, it seems I was partially right.
> 
> 
> :: Steps to reproduce:
> 1. `USE=xattr emerge portage dev-db/postgresql postgis`
> 
> ... 
> 
> make[2]: Entering directory
> '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'
> /bin/mkdir -p
> '/var/tmp/portage/dev-db/postgis-2.1.8/image//usr/share/postgresql-9.4/
> contrib/postgis-2.1'
> /var/tmp/portage/._portage_reinstall_.8tjeeiyk/bin/ebuild-helpers/xattr/
> install -c -m 644 postgis_comments.sql raster_comments.sql
> topology_comments.sql
> '/var/tmp/portage/dev-db/postgis-2.1.8/image//usr/share/postgresql-9.4/
> contrib/postgis-2.1/'
> make[2]: Leaving directory
> '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'
> make[1]: Leaving directory
> '/var/tmp/portage/dev-db/postgis-2.1.8/work/postgis-2.1.8/doc'
> 
> ...
> 
> 2. USE=xattr emerge postgis
> 
> What happens:
>  postgresql wrongly records path, so next emerge postgis fails!
> 
> # fgrep _portage_reinstall_
> /usr/lib64/postgresql-9.4/lib64/pgxs/src/Makefile.global 
> install_bin =
> /var/tmp/portage/._portage_reinstall_.8tjeeiyk/bin/ebuild-helpers/xattr/
> install -c
> 
> :: Fix
>  something should be done in postgresql or portage, not postgis
> 
> :: Workaround
>  `emerge postgresql postgis`
> 
> I wonder if there are other packages failing in this way with
> >=sys-apps/portage-2.2.19 ??
> If so, reopening bug #547086 is in order.

In the file /usr/lib64/postgresql-${SLOT}/lib64/pgxs/src/Makefile.global there's the following line:
install_bin = /usr/bin/install -c

Try changing it to:
install_bin = install -c

If it works, I'll figure out how to make the PostgreSQL ebuild spit out a modified Makefile.global.
Comment 14 Mira Ressel 2015-12-14 23:07:58 UTC
Postgres populates this line with the path to the current install utility on compilation, so it isn't going to be
  install_bin = /usr/bin/install -c
on the affected systems. For example, over here it's
  install_bin = /usr/lib/portage/python3.4/ebuild-helpers/xattr/install -c

But if you could statically replace this line by
  install_bin = install -c
, this should in fact resolve the bug. I've just verified this approach works for dev-db/postgis.

I've also verified that portage in fact places the .../xattr/install utility in PATH, so just calling "install" will  use the xattr-install instead of /usr/bin/install, just as desired.
Comment 15 Mira Ressel 2015-12-14 23:11:07 UTC
Doing so should be quite easy; it looks like it'd be sufficient to do
  sed -ie 's/@install_bin@/install -c/' src/Makefile.global.in
at a suitable spot in src_prepare().
Comment 16 Aaron W. Swenson gentoo-dev 2015-12-15 05:23:34 UTC
(In reply to Luis Ressel from comment #15)
> Doing so should be quite easy; it looks like it'd be sufficient to do
>   sed -ie 's/@install_bin@/install -c/' src/Makefile.global.in
> at a suitable spot in src_prepare().

Excellent. That's what I was thinking it'd be, but I hadn't looked at that file yet.
Comment 17 Aaron W. Swenson gentoo-dev 2015-12-15 21:42:27 UTC
As mentioned in the previous comments, the fix needed to be implemented in the PostgreSQL ebuilds as PostGIS sources files generated by that package.

commit 17eb751adda1ed29ae00e12e47199b09ff7f4673
Author: Aaron W. Swenson <titanofold@gentoo.org>
Date:   Tue Dec 15 16:39:51 2015 -0500

    dev-db/postgresql:  Hardcode install
    
    Rely on $PATH being in the proper order so that the correct install
    program is used for modules utilizing PGXS in both hardened and
    non-hardened environments.
    
    Bug: 528786
    
    Package-Manager: portage-2.2.20.1
Comment 18 Thomas Beutin 2015-12-18 11:02:06 UTC
it hits in #568612 again :(
Comment 19 Thomas Beutin 2015-12-18 11:16:38 UTC
Sorry for the noise - the recompile of dev-db/postgresql fixed bug 568612.