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

Bug 531786

Summary: sys-apps/portage: poor handling of virtual/jdk+jre resolution
Product: Portage Development Reporter: Michał Górny <mgorny>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: esigra, moonlapse81
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 141118    
Bug Blocks: 155723    

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-06 10:09:47 UTC
Related: https://bugs.funtoo.org/browse/FL-1219

The idea is that you have three ebuilds:

virtual/jre-1.7.0: || ( =dev-java/oracle-jre-bin-1.7.0* =virtual/jdk-1.7* )
virtual/jdk-1.7.0: || ( =dev-java/oracle-jdk-bin-1.7.0* ... )
app-office/test-1: DEPEND=virtual/jdk RDEPEND=virtual/jre

So pretty much the Gentoo virtuals with ordering changed to prefer Oracle. Now, if you emerge app-office/test, portage gives you:

[ebuild  N     ] app-office/test-1 
[ebuild  N     ]  virtual/jdk-1.7.0-r1 
[ebuild  N     ]   dev-java/oracle-jdk-bin-1.7.0.72  USE="X alsa fontconfig nsplugin (-aqua) -derby -doc -examples -jce -pax_kernel (-selinux) -source" 
[ebuild  N     ]  virtual/jre-1.7.0-r1 
[ebuild  N     ]   dev-java/oracle-jre-bin-1.7.0.72  USE="X alsa nsplugin -fontconfig -jce -pax_kernel (-selinux)" 
[ebuild  N     ]    app-admin/eselect-java-0.1.0 
[ebuild  N     ]    dev-java/java-config-2.2.0-r1000  PYTHON_ABIS="2.7 3.3 -2.6 -3.1 -3.2 -3.4 (-3.5)" 
[ebuild  N     ]     dev-java/java-config-wrapper-0.16 
[ebuild  N     ]     sys-apps/baselayout-java-0.1.0 

which is kinda unnecessary, since oracle-jdk-bin can satisfy virtual/jre via virtual/jdk, and I think we have some code already to assume virtuals are zero-cost.

Worse than that, if I inline the virtual in virtual/jre, i.e.:

virtual/jre-1.7.0: || ( =dev-java/oracle-jre-bin-1.7.0* =dev-java/oracle-jdk-bin-1.7.0* ... )
virtual/jdk-1.7.0: || ( =dev-java/oracle-jdk-bin-1.7.0* ... )

Portage behaves the same even though oracle-jdk-bin is a common subset of the two virtuals.