Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 368725 - sys-apps/portage-2.2.0_alpha36 builds dependencies from installed ebuilds not current tree
Summary: sys-apps/portage-2.2.0_alpha36 builds dependencies from installed ebuilds not...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on: 282927
Blocks:
  Show dependency tree
 
Reported: 2011-05-25 18:18 UTC by Graham Murray
Modified: 2011-06-08 05:45 UTC (History)
1 user (show)

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


Attachments
xawtv-3.95-r2 from /var/pkg (xawtv-3.95-r2.ebuild,3.62 KB, application/octet-stream)
2011-05-25 18:18 UTC, Graham Murray
Details
bziped (to bring within max attachment size) output of emerge --debug (emerge.debug.bz2,838.54 KB, application/x-bzip2)
2011-05-25 18:48 UTC, Graham Murray
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2011-05-25 18:18:59 UTC
Created attachment 274637 [details]
xawtv-3.95-r2 from /var/pkg

emerge -puDv --reinstall changed-use @world

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

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "virtual/quicktime".
(dependency required by "media-tv/xawtv-3.95-r2" [installed])
(dependency required by "@selected" [set])
(dependency required by "@world" [argument])

In the current tree, media-tv/xaw-3.95-r2 depends on media-libs/quicktime, but at the time media-tv/xaw-3.95-r2 was installed, the ebuild had a depend on virtual/quicktime.

emerge --info =media-tv/xawtv-3.95-r2
Portage 2.2.0_alpha36 (default/linux/x86/10.0/desktop, gcc-4.5.2, glibc-2.13-r2, 2.6.39-gentoo i686)
=================================================================
                         System Settings
=================================================================
System uname: Linux-2.6.39-gentoo-i686-Intel-R-_Core-TM-2_CPU_6700_@_2.66GHz-with-gentoo-2.0.2
Timestamp of tree: Wed, 25 May 2011 16:45:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.6-r2, 2.7.1-r1, 3.1.3, 3.2
dev-util/cmake:           2.8.4-r1
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.6.3-r1, 1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21
sys-devel/gcc:            4.3.5, 4.4.5, 4.5.2
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.13-r2
Repositories: gentoo perl-experimental sunrise x11 kde newton_local
Installed sets: 
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --autounmask-write y"
FEATURES="assume-digests binpkg-logs buildsyspkg distlocks ebuild-locks fixlafiles fixpackages installsources news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://mirror.qubenet.net/mirror/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ ftp://mirrors.linuxant.fr/distfiles.gentoo.org/ http://mirror.bytemark.co.uk/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en fr_FR fr"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/perl-experimental /var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/kde /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi aim alsa apache2 audiofile avi bash-completion berkdb bluetooth bonobo branding browserplugin bzip2 bzlib cairo caps cdda cddb cdparanoia cdr cjk cli consolekit cracklib crypt cups curl cvs cxx dbus directfb doc dri dts dv dvd dvdr dvdread eds emacs emboss encode esd ethereal examples exif expat fam fbcon ffmpeg fftw flac fontconfig foomaticdb fortran ftp gcj gd gdbm gdu geoip gif glut gmp gnome gnome-keyring gnutls gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml guile htmlhandbook iconv icq icu idn imagemagick imlib ipv6 jabber jack java javascript jbig jce jpeg jpeg2k junit kde kdehiddenvisibility ladspa latex lcms ldap leim libgda libnotify libsamplerate libwww lm_sensors logrotate lua lzma mad matroska mbox mikmod milter mime mmap mmx mng modplug modules mono mozilla mp3 mp4 mpeg mpi mplayer msn mtp mudflap musepack musicbrainz mysql ncurses nls nptl nptlonly nsplugin odbc offensive ogg oggvorbis openal opengl openmp oscar oss pam pango pcntl pcre pdf perl php plasma png policykit postgres ppds pppd profile pulseaudio python qt3support qt4 quicktime raw readline recode ruby samba sasl sdl semantic-desktop session sharedmem sndfile snmp soap sockets sox speex spell sqlite sqlite3 sse sse2 sse3 ssl ssse3 startup-notification subversion svg sysfs sysvipc tcl tcltk tcpd theora threads tiff tk truetype udev unicode usb v4l v4l2 vim-syntax vorbis wavpack win32codecs wmf wxwindows x264 x86 xattr xcb xcomposite xface xft xine xml xml2 xorg xulrunner xv xvid yahoo zlib" ALSA_CARDS="hda-intel" 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="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="canon 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en fr_FR fr" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon vesa fbdev vga v4l r300" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

media-tv/xawtv-3.95-r2 was built with the following:
USE="X aalib alsa dv mmx nls opengl quicktime xext xv -lirc -motif -zvbi"
CFLAGS="-O2 -march=native -mtune=native -pipe -ggdb -I/usr/include/X11/fonts"
CXXFLAGS="-O2 -march=native -mtune=native -pipe -ggdb -I/usr/include/X11/fonts"
LDFLAGS="-Wl,--as-needed,-O1"
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-05-25 18:25:47 UTC
Thanks for the report, assigning to dev-portage team for triage.
Comment 2 Sebastian Luther (few) 2011-05-25 18:36:06 UTC
Please rerun the command with --debug added and attach the output.
Comment 3 Graham Murray 2011-05-25 18:48:12 UTC
Created attachment 274643 [details]
bziped (to bring within max attachment size) output of emerge --debug
Comment 4 Sebastian Luther (few) 2011-05-25 20:10:48 UTC
(In reply to comment #0)
> In the current tree, media-tv/xaw-3.95-r2 depends on media-libs/quicktime, but
> at the time media-tv/xaw-3.95-r2 was installed, the ebuild had a depend on
> virtual/quicktime.

You're right. There was another report about this on IRC. It probably broke in one of the following two commits:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commitdiff;h=88ab3aed122734578dc4939403c9393d8afbf6ae

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commitdiff;h=4b6b6dbed2ef61dfdb1cb5420e15c2de4561a992
Comment 5 Zac Medico gentoo-dev 2011-05-25 22:18:38 UTC
(In reply to comment #4)
> (In reply to comment #0)
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commitdiff;h=88ab3aed122734578dc4939403c9393d8afbf6ae

The EAPI comparison is the commit that has caused the change in behavior. You can see that the EAPI was bumped from 0 to 1 in revision 1.6:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-tv/xawtv/xawtv-3.95-r2.ebuild?view=log#rev1.6

I'd like to keep the new behavior because if we don't respect the EAPI of the installed instance then it can cause various problems. For example, if the installed instance had an unsupported EAPI then we don't want to try to execute its pkg_prerm and pkg_postrm phases. This was the issue that prompted me to make the change.

A possible solution would be the --reinstall-changed-ebuild option (similar to --newuse) suggested in bug 282927.
Comment 6 Zac Medico gentoo-dev 2011-05-26 01:14:45 UTC
(In reply to comment #5)
> I'd like to keep the new behavior because if we don't respect the EAPI of the
> installed instance then it can cause various problems. For example, if the
> installed instance had an unsupported EAPI then we don't want to try to execute
> its pkg_prerm and pkg_postrm phases. This was the issue that prompted me to
> make the change.

As a compromise, I've made it use the live metadata if both the installed an live EAPIs are supported:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d810f9a0b160a91fae059a5c32c1b673fe7be3be
Comment 7 Zac Medico gentoo-dev 2011-05-27 05:00:44 UTC
This is fixed in 2.2.0_alpha37.
Comment 8 Aleksandar Petrinic 2011-06-07 21:10:39 UTC
Why portage builds dependencies from the tree ? It's more sensible to consider deps of already installed packages (in the case it wants to keep them and don't want to reinstall).
I mean... keep the installed package but consider the deps of the main tree (equivalent version) is conceptually broken. With different metadata they could be very different packages. With overlays the situation could be even more weird.
And also --depclean will probably do the wrong thing, considering the wrong deps.

So... what's the point of all of this ?
Why not make portage to handle this in the right way and enforce the policy of the ebuild revision bumps ? In that way we have more chances to have bullet-prof upgrades, and not like now that the users sometimes must resolve this kind of mess by themself.
Comment 9 Zac Medico gentoo-dev 2011-06-08 05:45:43 UTC
(In reply to comment #8)
> Why portage builds dependencies from the tree ? It's more sensible to consider
> deps of already installed packages (in the case it wants to keep them and don't
> want to reinstall).

The current behavior is for backward compatibility with previous versions of portage, and it is certainly undesirable in some ways. Moving forward, we have at least a couple of options:

A) Create a dependency patching mechanism which will behave very much like the existing backward compatible behavior, but will include some control mechanism which can be used to selectively prevent dependency patches from being applied in cases when there is some way to determine that they are inapplicable.

B) Trigger automatic rebuilds of packages that have changed dependencies (as in bug 282927). This has the disadvantage of possibly time-consuming rebuilds that don't really serve any purpose except to patch the dependency metadata.

> I mean... keep the installed package but consider the deps of the main tree
> (equivalent version) is conceptually broken. With different metadata they could
> be very different packages. With overlays the situation could be even more
> weird.

The current code uses the repo_name metadata to ensure that repos don't interfere with eachother.

> And also --depclean will probably do the wrong thing, considering the wrong
> deps.

Currently, the most annoying issue is that updated runtime dependencies for packages that are only pulled into the graph by --with-bdeps=y are sometimes left unsatisfied after world updates, due to the default --with-bdeps=n behavior of update commands. I've recently updated depclean's error message for this case, in order to guide users since they can be confused by this case:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=acddb2ec3ccb332b048eb1ebedba63d555fa46a0

> So... what's the point of all of this ?

Well, just throwing out the backward compatible behavior tends to lead to complaints, as evidenced by this bug being filed less than 24 hours after portage-2.2.0_alpha36 was released.

> Why not make portage to handle this in the right way and enforce the policy of
> the ebuild revision bumps ?

As mentioned above, this has the disadvantage to possibly time-consuming rebuilds that don't really serve any purpose except to patch the dependency metadata.

> In that way we have more chances to have
> bullet-prof upgrades, and not like now that the users sometimes must resolve
> this kind of mess by themself.

I agree that the current situation is not really optimal, and I'd like to implement something better.