Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586438 - sys-apps/portage: Only enable prefix QA checks when prefix USE flag is active
Summary: sys-apps/portage: Only enable prefix QA checks when prefix USE flag is active
Status: RESOLVED INVALID
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-19 23:14 UTC by Michael Weiser
Modified: 2016-06-20 09:32 UTC (History)
0 users

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


Attachments
Only enable prefix QA checks if prefix USE flag is active (prefix-portage-2.2.28-prefix-cross.patch,358 bytes, patch)
2016-06-19 23:15 UTC, Michael Weiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weiser 2016-06-19 23:14:51 UTC
When cross-compiling for another platform from inside a prefix, files created for the target will most of the time not be inside an identical prefix. So the install-qa-check.d/05prefix QA checks should be disabled if the prefix USE flag has been disabled (by the target platform's profile).

Reproducible: Always

Actual Results:  
emerge-armv7ve-hardfloat-linux-gnueabi -1at static-dev
These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  N     ] sys-fs/static-dev-0.1 to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/usr/local/gentoo/
[ebuild  N     ]  sys-apps/makedev-3.23.1 to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/usr/local/gentoo/ USE="-build (-selinux)" 

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix for /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/usr/local/gentoo/
>>> Jobs: 0 of 2 complete, 1 running                Load avg: 2.81, 1.98, 1.59!!! post install failed; exiting.
>>> Failed to emerge sys-apps/makedev-3.23.1 for /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/usr/local/gentoo/, Log file:
>>>  '/usr/local/gentoo/var/tmp/portage/sys-apps/makedev-3.23.1/temp/build.log'
[...]
 * QA Notice: the following files are outside of the prefix:
 * /etc
 * /etc/makedev.d
 * /etc/makedev.d/00macros
[...]
 * /sbin
 * /sbin/MAKEDEV
 * /usr/sbin
 * /usr/sbin/mksock
 * /usr/share
 * /usr/share/man
 * /usr/share/man/man8
 * /usr/share/man/man8/MAKEDEV.8
 * ERROR: sys-apps/makedev-3.23.1::gentoo_prefix failed:
 *   Aborting due to QA concerns: there are files installed outside the prefix


Expected Results:  
emerge-armv7ve-hardfloat-linux-gnueabi -1at static-dev

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  N     ] sys-fs/static-dev-0.1 
[ebuild  N     ]  sys-apps/makedev-3.23.1  USE="-build (-selinux)" 

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix
>>> Installing (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix
>>> Emerging (2 of 2) sys-fs/static-dev-0.1::local-overlay
>>> Installing (2 of 2) sys-fs/static-dev-0.1::local-overlay
>>> Jobs: 2 of 2 complete                           Load avg: 2.87, 2.06, 1.69
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
Comment 1 Michael Weiser 2016-06-19 23:15:36 UTC
Created attachment 438064 [details, diff]
Only enable prefix QA checks if prefix USE flag is active
Comment 2 Benda Xu gentoo-dev 2016-06-20 00:23:12 UTC
For the present portage which support cross-prefix, if you don't want EPREFIX in cross-emerge, please specify --prefix="/" to emerge or set EPREFIX="/" in the environment.  Does that fix it?
Comment 3 Michael Weiser 2016-06-20 06:47:22 UTC
No, because this disables prefix altogehter and portage tries to merge the package into the host system's root filesystem:

>>> Installing (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix
!!! copy /usr/local/gentoo/var/tmp/portage/sys-apps/makedev-3.23.1/image/dev/.keep_sys-apps_makedev-0 -> /dev/.keep_sys-apps_makedev-0 failed.
!!! [Errno 45] Operation not supported: b'/dev/.keep_sys-apps_makedev-0#new'

>>> Failed to install sys-apps/makedev-3.23.1, Log file:

Merging cross-compiled packages for a non-prefix works as expected when linking $EPREFIX/usr/$CTARGET/etc/portage/make.profile to a standard gentoo profile because that profile will not have the prefix use flag set, disabling the prefix logic for that target system but leaving it intact and active in the host portage. The only thing needed is my attached patch to disable the prefix QA logic in that case.

ls -la /usr/local/gentoo/usr/armv7ve-hardfloat-linux-gnueabi/etc/portage/make.profile
lrwxr-xr-x 1 root wheel 55 Jun 20 00:21 /usr/local/gentoo/usr/armv7ve-hardfloat-linux-gnueabi/etc/portage/make.profile -> ../../../portage/profiles/default/linux/arm/13.0/armv7a

root@osx:/usr/local/gentoo/usr $ emerge --info >a
root@osx:/usr/local/gentoo/usr $ emerge-armv7ve-hardfloat-linux-gnueabi --info > b
root@osx:/usr/local/gentoo/usr $ diff -u a b
--- a	2016-06-20 08:37:47.000000000 +0200
+++ b	2016-06-20 08:37:57.000000000 +0200
@@ -1,8 +1,9 @@
-Portage 2.2.28-prefix (python 3.5.1-final-0, prefix/darwin/macos/10.11/x64, gcc-4.2.1, unavailable, 15.5.0 x86_64)
+Portage 2.2.28-prefix (python 3.5.1-final-0, default/linux/arm/13.0/armv7a, gcc-5.3.0, unavailable, 15.5.0 x86_64)
 =================================================================
 System uname: Darwin-15.5.0-x86_64-i386-64bit
 Timestamp of repository gentoo_prefix: Wed, 01 Jun 2016 10:27:56 +0000
 sh bash 4.3_p39
+ld GNU ld (Gentoo 2.26) 2.26.20160125
 app-shells/bash:      4.3_p39::gentoo_prefix
 dev-lang/perl:        5.24.0::gentoo_prefix
 dev-lang/python:      2.7.11::gentoo_prefix, 3.5.1::gentoo_prefix
@@ -23,31 +24,31 @@
     priority: -1000
     aliases: gentoo
 
-local
-    location: /usr/local/gentoo/usr/local/portage
+local-overlay
+    location: /usr/local/gentoo/usr/armv7ve-hardfloat-linux-gnueabi/usr/local/portage
     masters: gentoo_prefix
     priority: 0
 
-ACCEPT_KEYWORDS="~x64-macos"
+ACCEPT_KEYWORDS="arm ~arm"
 ACCEPT_LICENSE="* -@EULA"
 CBUILD="x86_64-apple-darwin15"
-CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
-CHOST="x86_64-apple-darwin15"
+CFLAGS="-O2 -pipe -march=armv7-a"
+CHOST="armv7ve-hardfloat-linux-gnueabi"
 CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt"
 CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
-CXXFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
+CXXFLAGS="-O2 -pipe -march=armv7-a"
 DISTDIR="/usr/local/gentoo/usr/portage/distfiles"
 EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=10 --with-bdeps=y"
-FCFLAGS=""
-FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged userfetch userpriv usersandbox usersync"
-FFLAGS=""
+FCFLAGS="-O2 -pipe -march=armv7-a"
+FEATURES="assume-digests binpkg-logs case-insensitive-fs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged userfetch userpriv usersandbox usersync"
+FFLAGS="-O2 -pipe -march=armv7-a"
 GENTOO_MIRRORS="http://distfiles.gentoo.org"
-LDFLAGS="-Wl,-dead_strip_dylibs"
+LDFLAGS="-Wl,-O1 -Wl,--as-needed"
 MAKEOPTS="-j2"
 PKGDIR="/usr/local/gentoo/usr/portage/packages"
-PORTAGE_CONFIGROOT="/usr/local/gentoo/"
+PORTAGE_CONFIGROOT="/usr/local/gentoo/usr/armv7ve-hardfloat-linux-gnueabi/"
 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 --exclude=/.git"
 PORTAGE_TMPDIR="/usr/local/gentoo/var/tmp"
-USE="aqua bzip2 cairo coreaudio cracklib cxx fontconfig iconv idn ipv6 ithreads jpeg kerberos kpathsea logrotate mbox mmap mmx mmxext modules ncurses objc objc++ openssl pic png prefix prefix-guest readline recode slang sse sse2 ssl threads tidy tiff unicode x64-macos xml zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
+USE="arm armv5te armv6 armv6t2 bzip2 cracklib crypt cxx iconv idn ipv6 kerberos logrotate mbox modules ncurses nptl openssl pam pcre readline recode seccomp ssl tcpd truetype unicode xinetd zlib" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_5" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap omapfb dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
 Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 4 Michael Weiser 2016-06-20 07:42:15 UTC
Update: cross-emerging without ROOT set seems to be a braindead idea since it installs into $EPREFIX/usr/$CTARGET but records the installed packages in $EPREFIX/var/db/pkg, poisoning the host prefix's package database. When emerging with ROOT set, --prefix=/ is indeed needed and works as expected. My patch is no longer necessary. Sorry for the noise.

michael@osx:~# ROOT=/usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi emerge-armv7ve-hardfloat-linux-gnueabi --prefix=/ -1at static-dev
These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild  N     ] sys-fs/static-dev-0.1 to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/
[ebuild  N     ]  sys-apps/makedev-3.23.1 to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/ USE="-build (-selinux)" 

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Emerging (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix for /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/
>>> Installing (1 of 2) sys-apps/makedev-3.23.1::gentoo_prefix to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/
>>> Emerging (2 of 2) sys-fs/static-dev-0.1::local-overlay for /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/
>>> Installing (2 of 2) sys-fs/static-dev-0.1::local-overlay to /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/
>>> Jobs: 2 of 2 complete                           Load avg: 2.91, 1.90, 1.31
>>> Auto-cleaning packages...

>>> Using system located in ROOT tree /usr/local/gentoo/eroot/armv7ve-hardfloat-linux-gnueabi/

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
Comment 5 Benda Xu gentoo-dev 2016-06-20 09:32:55 UTC
Michael, thanks for working on this.  This bug will be a good reference to people.