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

Bug 278729

Summary: unsatisfied USE deps cause bad handling of || dependencies
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, tommy
Priority: High Keywords: InVCS
Version: 2.1   
Hardware: All   
OS: All   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=612602
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 155723, 210077, 288499    
Attachments: prefer choices with satisfied USE deps, applies to 2.2_rc35
prefer choices with satisfied USE deps, applies to 2.2_rc35

Description Zac Medico gentoo-dev 2009-07-22 18:39:09 UTC
We need to add special USE dep handling to dep_zapdeps() so that it ranks the choices correctly when one of the choices is already installed or in graph but happens to have incorrect USE settings.
Comment 1 Zac Medico gentoo-dev 2009-08-03 21:20:47 UTC
This is fixed in svn r13881.
Comment 2 Zac Medico gentoo-dev 2009-08-03 23:13:03 UTC
This is fixed in 2.2_rc34.
Comment 3 Zac Medico gentoo-dev 2009-08-04 05:29:03 UTC
(In reply to comment #2)
> This is fixed in 2.2_rc34.

The current code behaves badly for cases like kde-base/nepomuk:

|| (
  >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,redland]
  >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,java]
)

I needs to be fixed to distinguish between these two cases and prefer the one which is already satisfied by current USE configuration.
Comment 4 Zac Medico gentoo-dev 2009-08-04 06:23:37 UTC
Created attachment 200110 [details, diff]
prefer choices with satisfied USE deps, applies to 2.2_rc35

This fixes the issue described in comment #3.
Comment 5 Zac Medico gentoo-dev 2009-08-04 07:23:24 UTC
Created attachment 200119 [details, diff]
prefer choices with satisfied USE deps, applies to 2.2_rc35  	 

This fixes a bug in the previous patch.
Comment 6 Zac Medico gentoo-dev 2009-08-04 08:56:53 UTC
(In reply to comment #5)
> Created an attachment (id=200119) [edit]
> prefer choices with satisfied USE deps, applies to 2.2_rc35      
> 
> This fixes a bug in the previous patch.
> 

It seems that this patch actually reverts the behavior that this bug was aimed at fixing, so part of it needs to be redone now. Specifically, USE state ("all_use_satisfied") needs to affect the order of the "preferred" list inside dep_zapdeps.
Comment 7 Zac Medico gentoo-dev 2009-08-27 07:54:13 UTC
There's a new patch in svn r14165 that will handle || ( foo[a] foo[b] ) correctly now. This patch is not able to distinguish between some cases of || ( foo[a] foo[b] ) and || ( foo[a] bar ), so it could use some improvement.
Comment 8 Zac Medico gentoo-dev 2009-09-20 00:21:41 UTC
This is fixed in 2.2_rc41.
Comment 9 Zac Medico gentoo-dev 2009-10-11 00:57:45 UTC
This is fixed in 2.1.7.
Comment 10 Zac Medico gentoo-dev 2011-08-21 00:04:47 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > This is fixed in 2.2_rc34.
> 
> The current code behaves badly for cases like kde-base/nepomuk:
> 
> || (
>   >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,redland]
>   >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,java]
> )
> 
> I needs to be fixed to distinguish between these two cases and prefer the one
> which is already satisfied by current USE configuration.

Note that this "good behavior" for the above dependency is not so good for virtual/fortran:

  || (
    sys-devel/gcc[fortran,openmp?]
    sys-devel/gcc-apple[fortran,openmp?]
    dev-lang/ifc
    dev-lang/ekopath-bin
  )

Currently, if the user has USE=fortran disabled, then dev-lang/ifc gets pulled in by default. See bug 372513, also discussed on gentoo-portage-dev ml:

  http://archives.gentoo.org/gentoo-portage-dev/msg_dcaad2f45f48b0505d448604e4fe5901.xml