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

Bug 378741

Summary: dev-java/jdom dev-java/jdom-jaxen circular dependencies trigger java-utils-2.eclass java-pkg_switch-vm failure due wrong PDEPEND assumptions
Product: Gentoo Linux Reporter: Fabio Erculiani (RETIRED) <lxnay>
Component: New packagesAssignee: Java team <java>
Status: RESOLVED WONTFIX    
Severity: normal CC: brad, dschridde+gentoobugs, treecleaner, ulm
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://archives.gentoo.org/gentoo-dev/msg_9918c8427c3213960f431f68344fd12e.xml
Whiteboard: Pending removal: 2018-07-17
Package list:
Runtime testing required: ---
Bug Depends on: 559994    
Bug Blocks:    

Description Fabio Erculiani (RETIRED) gentoo-dev 2011-08-11 07:27:03 UTC
jdom-jaxen is only listed as PDEPEND.
Given current PDEPEND specification, anything that expects to have it available before the end of the PM merge schedule is broken and has to be fixed.

For example, in case of app-office/libreoffice emerged with USE="java", during pkg_setup, java-pkg_switch-vm gets called and the snippet below expects to find a completely sane JDK environment:

elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
    debug-print "depend-java-query:  NV_DEPEND:     ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
    GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
    if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
        die <- it dies here

At that point, if java-check-environment is polled, it says:
* Checking package_env ...
!!! ERROR: Package jdom-jaxen-1.0 was not found!
 * Broken dependencies for dev-java/jdom-1.0-r4
 * Please try emerge -uD1 =dev-java/jdom-1.0-r4

The solution would be creating a virtual package for jdom, containing dev-java/jdom and dev-java/jdom-jaxen as RDEPEND and fixup all the reverse dependencies.


Reproducible: Always
Comment 1 Ulrich Müller gentoo-dev 2011-08-11 08:50:30 UTC
Generally, you cannot rely on any dependency (outside of the system set) being present in pkg_setup:

<http://dev.gentoo.org/~ulm/pms/head/pms.html#x1-720008>
Comment 2 Ralph Sennhauser (RETIRED) gentoo-dev 2011-10-05 09:57:19 UTC
(In reply to comment #0)
> For example, in case of app-office/libreoffice emerged with USE="java", during
> pkg_setup, java-pkg_switch-vm gets called and the snippet below expects to find
> a completely sane JDK environment:
>
> elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
>     debug-print "depend-java-query:  NV_DEPEND:    
> ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
>     GENTOO_VM="$(depend-java-query --get-vm
> "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
>     if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
>         die <- it dies here

It expects to find an installed JDK matching the spec in DEPEND. The only time this is clearly broken is if MERGE_TYPE == binary and isn't related to jdom-jaxen.

However, would have been interesting to see the actual die message and to know the available JDKs to rule out a bug in java-config.

> 
> At that point, if java-check-environment is polled, it says:
> * Checking package_env ...
> !!! ERROR: Package jdom-jaxen-1.0 was not found!
>  * Broken dependencies for dev-java/jdom-1.0-r4
>  * Please try emerge -uD1 =dev-java/jdom-1.0-r4
> 

Which is perfectly valid as the batch install didn't succeed and so the system can't be assumed to be in a clean state. If something wants jdom-jaxen it should DEPEND on it instead of jdom, which is the current solution.

> The solution would be creating a virtual package for jdom, containing
> dev-java/jdom and dev-java/jdom-jaxen as RDEPEND and fixup all the reverse
> dependencies.
> 

One more solution to jdom being in a dependency cycle with jaxen is to make jaxen a useflag for jdom. This would result in the jar being the same as upstream is shipping. On the downside it requires the user to toggle a useflag for a first install.

Ideally the packages jdom and jdom-jaxen would have been named the other way around. Would have been less confusing to use jdom-jaxen for jaxen and jdom otherwise.
Comment 3 Dennis Schridde 2013-08-26 12:25:46 UTC
I currently get:
(dev-java/jdom-jaxen-1.0-r1::gentoo, ebuild scheduled for merge) depends on
 (dev-java/jaxen-1.1.4-r1::gentoo, ebuild scheduled for merge) (buildtime)
  (dev-java/jdom-jaxen-1.0-r1::gentoo, ebuild scheduled for merge) (buildtime)

Is this the same bug? How can it be fixed?
Comment 4 William L. Thomson Jr. 2015-03-20 19:46:16 UTC
I don't think jdom relies on its own jaxen anymore. I never use that when I use jdom. It seems to be a dep for after install. I just provided updated ebuilds for jdom 1.x bug 215958 and jdom 2.x bug 496986. Neither of those are using jdom-jaxen. I think the entire jdom-jaxen package can be removed once deps using jdom:1.0 are updated to jdom:0. That should fix the circular dependency problem.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-07-28 12:13:07 UTC
jdom-jaxen is being removed.