Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 461422 - sys-apps/portage- emerge --usepkg cancels out --rebuild-if-new-rev
Summary: sys-apps/portage- emerge --usepkg cancels out --rebuild-if-new-rev
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Reported: 2013-03-11 16:32 UTC by Roman Žilka
Modified: 2013-05-28 17:38 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Roman Žilka 2013-03-11 16:32:54 UTC
# emerge -pvuDN --complete-graph y --with-bdeps y --rebuild-if-new-rev y world

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

Calculating dependencies... done!
[ebuild     U  ] dev-libs/nettle-2.6:0/4 [2.5:0/0] USE="gmp {test%*} -doc% -static-libs%" 0 kB
[ebuild  rR    ] net-libs/gnutls-2.12.23  USE="cxx lzo nettle nls {test} zlib -bindist -doc -examples -guile -pkcs11 -static-libs" 0 kB
[ebuild     U  ] app-text/docbook-xsl-stylesheets-1.78.0 [1.77.1-r1] USE="-ruby" 0 kB
[ebuild  rR    ] app-text/xmlto-0.0.24-r1  USE="-latex" 0 kB
[ebuild     U  ] www-client/opera-12.14_p1738 [12.13_p1734] USE="gstreamer (multilib) -gtk -kde" LINGUAS="cs en_GB ja sk -af -ar -az -be -bg -bn -da -de -el -es_ES -es_LA -et -fa -fi -fr -fr_CA -fy -gd -he -hi -hr -hu -id -it -ka -kk -ko -lt -lv -me -mk -ms -nb -nl -nn -pa -pl -pt -pt_BR -ro -ru -sr -sv -sw -ta -te -th -tl -tr -uk -ur -uz -vi -zh_CN -zh_TW -zu" 0 kB

Total: 5 packages (3 upgrades, 2 reinstalls), Size of downloads: 0 kB

# emerge -BquDN --complete-graph y --with-bdeps y --keep-going y world
>>> Verifying ebuild manifests
>>> Starting parallel fetch
>>> Emerging (1 of 3) dev-libs/nettle-2.6
>>> Emerging (2 of 3) app-text/docbook-xsl-stylesheets-1.78.0
>>> Emerging (3 of 3) www-client/opera-12.14_p1738

# emerge -pkvuDN --complete-graph y --with-bdeps y --rebuild-if-new-rev y world

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

Calculating dependencies... done!
[binary     U  ] dev-libs/nettle-2.6:0/4 [2.5:0/0] USE="gmp {test%*} -doc% -static-libs%" 0 kB
[binary     U  ] app-text/docbook-xsl-stylesheets-1.78.0 [1.77.1-r1] USE="-ruby" 0 kB
[binary     U  ] www-client/opera-12.14_p1738 [12.13_p1734] USE="gstreamer (multilib) -gtk -kde" LINGUAS="cs en_GB ja sk -af -ar -az -be -bg -bn -da -de -el -es_ES -es_LA -et -fa -fi -fr -fr_CA -fy -gd -he -hi -hr -hu -id -it -ka -kk -ko -lt -lv -me -mk -ms -nb -nl -nn -pa -pl -pt -pt_BR -ro -ru -sr -sv -sw -ta -te -th -tl -tr -uk -ur -uz -vi -zh_CN -zh_TW -zu" 0 kB

Total: 3 packages (3 upgrades, 3 binaries), Size of downloads: 0 kB

I would expect that the last emerge includes gnutls and xmlto in the set. In the second emerge call I omit --rebuild-if-new-rev, becasue it makes no sense with -B together. But I would like -k not to rule out --rebuild-if-new-rev, if at all possible.

The use case for that is automatic nightly pre-packaging with the second emerge call, followed by the third one run manually. The point is to use --rebuild-if-new-rev, but be spared (during the day) of as much compiling time as possible, while avoiding automatic merging of anything into / in cron as some stuff needs attention right after the merge.

Reproducible: Always

Portage (hardened/linux/amd64, gcc-4.6.3, glibc-2.15-r3, 3.7.5 x86_64)
System uname: Linux-3.7.5-x86_64-Intel-R-_Core-TM-_i5-2520M_CPU_@_2.50GHz-with-gentoo-2.1
KiB Mem:     4022828 total,   2372728 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Mon, 11 Mar 2013 14:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
FCFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync news nodoc noinfo parallel-fetch parallel-install protect-owned sandbox sfperms strict test test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe -fomit-frame-pointer -march=core2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpclmul -mpopcnt -mcx16"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_EXTRA_OPTS="--sparse --itemize-changes --human-readable --stats --compress --compress-level=9"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 aac acpi aes-ni alsa amd64 avx avx256 bash-completion berkdb bluetooth bzip2 cddb cjk cli cracklib crypt cxx dri encode ffmpeg flac fontconfig ftp gdbm geoip gif gnutls gps gzip hardened hddtemp iconv icu idn imap javascript jpeg jpeg2k justify libass lm_sensors lzma lzo matroska mbox mime mms mmx modules mp3 mp4 mpeg mplayer mudflap multilib musicbrainz ncurses nls nocd nptl ogg opengl pam pax_kernel pcre pda pdf png postscript quicktime raw readline recode session smp sockets sound spell sse sse2 sse2_4way sse3 sse4_1 ssl ssse3 svg syslog threads truetype udev unicode urandom usb v4l vdpau videos vim-syntax vorbis wifi x264 xcomposite xosd xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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" 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 ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en cs sk ja" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="i965 intel vesa" 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"
Comment 1 Zac Medico gentoo-dev 2013-03-11 21:49:57 UTC
(In reply to comment #0)
> But I would like -k not to rule out
> --rebuild-if-new-rev, if at all possible.

While reviewing the relevant code in /usr/lib/portage/pym/_emerge/, I found this code which appears related to the behavior you observe:

def _needs_rebuild(self, dep_pkg):
	"""Check whether packages that depend on dep_pkg need to be rebuilt."""
	dep_root_slot = (dep_pkg.root, dep_pkg.slot_atom)
	if dep_pkg.built or dep_root_slot in self.orig_rebuild_list:
		return False

As you can see, if dep_pkg.built is True then it returns False and does not rebuild the parent package.

There's some related code in the _trigger_rebuild method which deals with binary packages, but the logic seems to assume that any necessary rebuilds would have been triggered in an earlier build (which would have happened if you weren't using --buildpkgonly).
Comment 2 Roman Žilka 2013-03-11 22:21:48 UTC
Thanks for finding the key. I'll do some additional good old manual emerging before this gets to portage. I lack the portage sourcecode knowledge that's required to investigate this thing with reasonable efficiency.