Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 82488

Summary: Virtuals discovered prior to dep checking are not verified against the dep graph
Product: Gentoo Linux Reporter: csights
Component: Current packagesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: sascha-gentoo-bugzilla, SebastianLuther, x11
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 270496, 288499    

Description csights 2005-02-18 11:46:54 UTC
Hi,
    I am having a problem with virtual dependencies being ignored.  The package dev-games/ode requires virtual/opengl which is provided by x11-base/xorg-x11 _when compiled with USE="opengl"_.  (ODE correctly reports its virtual dependency in the its ebuild.)




Reproducible: Always
Steps to Reproduce:
1.USE="-opengl -xv" emerge xorg-x11 ode
2.
3.

Actual Results:  
emerge "says" that nothing is wrong and tries to emerge xorg-x11 and ODE:

#USE="-opengl -xv" emerge -av xorg-x11 ode

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] x11-base/xorg-x11-6.8.0-r4  -3dfx +3dnow +bitmap-fonts -cjk
-debug -dlloader -dmx -doc +font-server -hardened -insecure-drivers -ipv6
-minimal +mmx +nls -opengl* +pam -sdk -sse -static +truetype-fonts +type1-fonts
(-uclibc)-xprint -xv* 0 kB
[ebuild  N    ] dev-games/ode-0.5-r2  -doc 0 kB


ODE fails to compile because of missing header files (GL/gl.h and others)

Expected Results:  
emerge should at least give some kind of warning about "failed virtual dependencies"

note that 
#emerge -av xorg-x11 ode
does compile correctly (because I have opengl and xv set in make.conf)

Gentoo Base System version 1.4.16
Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1
, 2.4.24-om2 i686)
=================================================================
System uname: 2.4.24-om2 i686 AMD Athlon(tm) Processor
Python:              dev-lang/python-2.3.4-r1,dev-lang/python-2.2.3-r5 [2.3.4 (#
1, Feb 14 2005, 20:17:21)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4-r1, 2.2.3-r5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.4.19-r1, 2.4.21-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS=" -march=athlon -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X1
1/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/
config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
 /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS=" -march=athlon -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://cudlug.cudenver.edu/gentoo/ http://gentoo.seren.com/gento
o http://gentoo.chem.wisc.edu/gentoo/ http://gentoo.mirrors.pair.com/"
MAKEOPTS="-j1"
PKGDIR="/mnt/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://sigunix.cwru.edu/gentoo-portage"
USE="x86 3dnow X apm avi berkdb bitmap-fonts crypt cups fam font-server gdbm gif
 gtk2 imagemagick jpeg libg++ mmx motif mpeg nls oggvorbis opengl pam png python
 quicktime readline real ssl tetex tiff truetype truetype-fonts type1-fonts xv z
lib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2005-02-18 11:56:20 UTC

*** This bug has been marked as a duplicate of 1343 ***
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-02-22 07:24:33 UTC
Marius, that's a different bug...


ode-0.5-r2:
DEPEND="virtual/opengl"

base/virtuals:
virtual/opengl  x11-base/xorg-x11

xorg-x11-6.8.0-r4:
PROVIDE="opengl? virtual/opengl"

There's actually two bugs here that will result in the same symptom. base/virtuals needs to use a (not-yet usable) USE-based dep, and the installed version of xorg-x11 that does provide the virtual is about to be reinstalled with one that doesn't. The latter problem should be fixable in 2.0.51.

x11 people, what other providers of virtual/opengl are there? Would it be possible to change the default to something that's not USE-based for the time being?
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2005-02-22 12:18:27 UTC
There used to be xfree and a separate mesa build, and there will probably be a separate mesa build again in the future. It's still in the tree but it's way old.

It would be possible to change it to a non-USE-based provide, but it would be wrong when X is built without USE=opengl. It would be as if X just decided to provide virtual/mta, virtual/alsa or whatever else.
Comment 4 Jason Stubbs (RETIRED) gentoo-dev 2005-02-25 19:59:50 UTC
Fair enough - so nothing can be done from the other side.
Comment 5 Zac Medico gentoo-dev 2009-06-29 22:23:58 UTC
This is easily fixed by using portdb.aux_get() to check PROVIDE inside portage._expand_new_virtuals(). The the USE conditionals are automatically evaluated since portdb in this scope is really and instance of depgraph._dep_check_composite_db which instantiates Package instances and evaluates their USE appropriately. The spot to change looks like this:

  # Plain old-style virtuals.  New-style virtuals are preferred.
  for y in mychoices:
    a.append(portage.dep.Atom(x.replace(mykey, y, 1)))

Before appending the atom there, first use portdb.match() with the atom, use portdb.aux_get() to get the PROVIDE, and check that the relevant virtual is contained in PROVIDE (it can contain multiple values, so split it first).
Comment 6 Zac Medico gentoo-dev 2009-06-30 04:39:28 UTC
This is fixed in svn r13742.
Comment 7 Sebastian Luther (few) 2009-06-30 06:07:33 UTC
The case where you install the provider and the consumer at once is solved now, but what about this:

A dpenends on virtual/xy
B has PROVIDE="useflag? ( virtual/xy )"

a) Install B with "useflag" enabled.
b) Install A
c) Re-install B with "useflag" disabled.

This works atm and leaves A broken.
Comment 8 Sebastian Luther (few) 2009-06-30 06:22:06 UTC
and one more problem: after doing steps a-c from the last comment:

$emerge A

emerge: there are no ebuilds to satisfy "virtual/xy".
(dependency required by "dev-libs/A-1.0" [ebuild])
(dependency required by "A" [argument])

It leaves the user with no information about how to solve the problem.
Currently the following happens:

1) Read the PROVIDE from ebuild.
2) Use use_reduce to simplify PROVIDE and decide if the package actually provides something. Leaving no indication that it provides/does not provide a virtual if you change a useflag.

What about the following?
2) Convert PROVIDE="useflag? ( virtual/xy )" from package cat/pkg-v to virtual/xy: cat/pkg-v[useflag]. 

Doing this would expand virtual/xy later on to cat/pkg-v[useflag] instead of either nothing or cat/pkg-v, giving the user the information to fix it.

Comment 9 Zac Medico gentoo-dev 2009-06-30 08:09:27 UTC
(In reply to comment #7)
> c) Re-install B with "useflag" disabled.

I'm planning to enable --complete-graph by default, and then it will bail out if they try to do that.

(In reply to comment #8)
> What about the following?
> 2) Convert PROVIDE="useflag? ( virtual/xy )" from package cat/pkg-v to
> virtual/xy: cat/pkg-v[useflag]. 
> 
> Doing this would expand virtual/xy later on to cat/pkg-v[useflag] instead of
> either nothing or cat/pkg-v, giving the user the information to fix it.

Seems a little convoluted. Why not just use a new-style virtual containing a USE dep? I guess you sort of want to generate a new-style virtual from an old-style virtual. I guess that's fine, but I'd encourage people to just use new-style virtuals instead.
Comment 10 Zac Medico gentoo-dev 2009-08-03 22:59:41 UTC
This is fixed in 2.2_rc34.
Comment 11 Zac Medico gentoo-dev 2009-10-11 00:43:54 UTC
This is fixed in 2.1.7.