Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539802 - dev-java/java-config should use-dep sys-apps/portage with PYTHON_TARGETS dependency (ERROR: No module named 'portage_dep' in media-libs/libjpeg-turbo-1.4.0)
Summary: dev-java/java-config should use-dep sys-apps/portage with PYTHON_TARGETS depe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-11 16:57 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2016-04-03 22:39 UTC (History)
1 user (show)

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


Attachments
emerge info (einfo,7.25 KB, text/plain)
2015-02-11 16:57 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2015-02-11 16:57:24 UTC
Created attachment 396188 [details]
emerge info

I accidentally managed to get my system in a state of :

dev-java/java-config-2.2.0:2::gentoo  PYTHON_TARGETS="python3_3 -python2_7 -python3_4"
sys-apps/portage-2.2.16::gentoo PYTHON_TARGETS="python2_7 python3_4 -pypy -python3_3"

( Its because I'm trying to weed out unnecessary deps on older pythons but its not always possible )

But there seems to be an inherent requirement that portage PYTHON_TARGETS must be a superset of java-config's.

The place I discovered this fact was in libjpeg-turbo, which fails under above configuration as follows, the relevant important part being: "!!! ERROR: No module named 'portage_dep'" 


---
>>> Emerging (1 of 2) media-libs/libjpeg-turbo-1.4.0::gentoo
 * libjpeg-turbo-1.4.0.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                    [ ok ]
 * libjpeg8_8d-2.debian.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                                   [ ok ]
!!! ERROR: No module named 'portage_dep'
 * Unable to determine VM for building from dependencies:
NV_DEPEND: !media-libs/jpeg:0
        !media-libs/jpeg:62
        abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
        amd64? ( || ( dev-lang/nasm dev-lang/yasm ) )
        x86? ( || ( dev-lang/nasm dev-lang/yasm ) )
        amd64-fbsd? ( || ( dev-lang/nasm dev-lang/yasm ) )
        x86-fbsd? ( || ( dev-lang/nasm dev-lang/yasm ) )
        amd64-linux? ( || ( dev-lang/nasm dev-lang/yasm ) )
        x86-linux? ( || ( dev-lang/nasm dev-lang/yasm ) )
        x64-macos? ( || ( dev-lang/nasm dev-lang/yasm ) )
        java? ( >=virtual/jdk-1.5 ) !<sys-devel/gettext-0.18.1.1-r3
        || ( >=sys-devel/automake-1.13:1.13 >=sys-devel/automake-1.15:1.15  )
        >=sys-devel/autoconf-2.69
        >=sys-devel/libtool-2.4 java? ( >=dev-java/java-config-2.1.9-r1  )
 * ERROR: media-libs/libjpeg-turbo-1.4.0::gentoo failed (setup phase):
 *   Failed to determine VM for building.
 * 
 * Call stack:
 *               ebuild.sh, line   93:  Called pkg_setup
 *               ebuild.sh, line  321:  Called java-pkg-opt-2_pkg_setup
 *   java-pkg-opt-2.eclass, line   48:  Called java-pkg_init
 *     java-utils-2.eclass, line 2065:  Called java-pkg_switch-vm
 *     java-utils-2.eclass, line 2538:  Called die
 * The specific snippet of code:
 *                                      die "Failed to determine VM for building."
 * 
 * If you need support, post the output of `emerge --info '=media-libs/libjpeg-turbo-1.4.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/libjpeg-turbo-1.4.0::gentoo'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info =libjpeg-turbo-1.4.0
---

I'm not entirely sure why this problem manifests, only that remerging java-config with PYTHON_TARGETS=python3_4  made this problem vanish.

I couldn't however replicate the initial fault conditions outside of portage.

The following yielded the same response regardless of the above adjustment.

# /usr/bin/depend-java-query --get-vm '!media-libs/jpeg:0
>         !media-libs/jpeg:62
>         abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
>                 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
>         amd64? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         x86? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         amd64-fbsd? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         x86-fbsd? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         amd64-linux? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         x86-linux? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         x64-macos? ( || ( dev-lang/nasm dev-lang/yasm ) )
>         java? ( >=virtual/jdk-1.5 ) !<sys-devel/gettext-0.18.1.1-r3
>         || ( >=sys-devel/automake-1.13:1.13 >=sys-devel/automake-1.15:1.15  )
>         >=sys-devel/autoconf-2.69
>         >=sys-devel/libtool-2.4 java? ( >=dev-java/java-config-2.1.9-r1  )'
oracle-jdk-bin-1.8


though this bugs purpose seems to directly conflict with bug #464608, having use-dep on portage to match its PYTHON_TARGETS useflags seems necessary.
Comment 1 Bodo Thiesen 2016-02-20 22:42:10 UTC
tl;dr: Make sure PYTHON_TARGES for sys-apps/portage and dev-java/java-config match. Workaround (untested): eselect python $one-version-for-which-both-portage-and-java-config-was-emerged

It's funny, how Gentoo developers can't figure out how to properly set correct dependencies on packages for almost since Gentoos existence. However, now it's becoming ridiculous, because the Gentoo developers even fail literally on their own packages. How many times did I report missing dependencies over the years? And trust me, most problems I solved, I didn'd even report. On my newest installation, I already went to Funtoo, my second newest system got ported to Funtoo a few weeks ago after too many conflicts, I guess the right way to go is to say goodby to Gentoo for good and just fully switch to Funtoo. It still uses broken-by-design portage, but at least some other problems of Gentoo are fixed there.

Anyways: When looking at /usr/lib64/python*/site-packages/java_config_2/VersionManager.py (first hit was 2.7 but doesn't matter) I found the import lines causing the issues, creating a simple x.py copying over those imports and I get the exact same problem reported. My currently selected python was 3.3 but sys-apps/portage has python_targets_python2_7 and python_targets_python3_4 set. This is no problem, python stuff can handle that, automagically switching to python_targets_python3_3 and python_targets_python3_4 set, so the default python 3.3 was used to execute the 3.3 version of java-config which then missed it's 3.3 portage counterpart. So the correct solution is to have dev-java/java-config enforce the same python tagets as sys-apps/portage. As a work around, you could also make sure to mark one python version active for which both, portage and java-config has been compiled.

One question that remains: Why do I - a "simple" Gentoo user have to tell Gentoo developers such a thing - that took me hours to investigate but should be an obvious thing to one fully into the matter?
Comment 2 James Le Cuirot gentoo-dev 2016-02-20 23:36:57 UTC
(In reply to Bodo Thiesen from comment #1)
> One question that remains: Why do I - a "simple" Gentoo user have to tell
> Gentoo developers such a thing - that took me hours to investigate but
> should be an obvious thing to one fully into the matter?

Quit with the attitude please. At the time this was filed, Java team was all but dead. I was not even a dev yet. monsieurp had yet to join the team. fordfrog generally only deals with specific packages like NetBeans.

I was therefore totally unaware of this bug. When I last updated my system, I decided to stick with Python 3.4. Don't forget that devs are users too and I didn't feel like dealing with any fallout from that at the time. Had I known it would have affected Java then sure, I would have tried it, but I didn't know.

java-config is also a complex piece of software that, despite not having seen a release in years, still works remarkably well so we've been reluctant to touch it. It's not perfect but we have plenty else to be getting on with and we're using that experience to gather ideas for what we might do to java-config when we have more time.

Someone did ask just a couple of days ago whether Python 3.5 could be added. I said I didn't know whether it would work so they said they would test it. I have yet to hear back.

It's late and I don't have the energy to parse this bug and understand why this happens but I'll have a look tomorrow.
Comment 3 James Le Cuirot gentoo-dev 2016-02-21 11:57:34 UTC
Fixed in -r3. Enjoy your open source crap.
Comment 4 Patrice Clement gentoo-dev 2016-02-21 14:47:23 UTC
(In reply to Bodo Thiesen from comment #1)
> It's funny, how Gentoo developers can't figure out how to properly set
> correct dependencies on packages for almost since Gentoos existence.
> However, now it's becoming ridiculous, because the Gentoo developers even
> fail literally on their own packages. How many times did I report missing
> dependencies over the years? And trust me, most problems I solved, I didn'd
> even report. On my newest installation, I already went to Funtoo, my second
> newest system got ported to Funtoo a few weeks ago after too many conflicts,
> I guess the right way to go is to say goodby to Gentoo for good and just
> fully switch to Funtoo. It still uses broken-by-design portage, but at least
> some other problems of Gentoo are fixed there.
> 

Quit the condescending tone, will you. 

Why would someone in his right mind waste his life pontificating about the greatness of distribution A and talking down to contributors of distribution B? Instead of writing complete nonsense in this bug report, you could have spent your time in a wiser way and sent a patch or a pull request to fix the problem because apparently, you seem to know it all. But hey.

Gentoo Linux is an open source effort like many other Linux distributions out there. If you don't like it, don't use it. Plain simple. Switch to whichever distribution makes your day. We accept criticism but this is over the top and on the brink of abuse.

I'm sick of running into grumpy and borderline disdainful users of your kind.  I'm not going to keep sitting here and endure your behaviour longer. Going forward, be extremely careful as to how you interact with us. This is a public forum and we're not the only one who can read it. You are warned.

Thank you.
Comment 5 James Le Cuirot gentoo-dev 2016-04-03 22:39:47 UTC
This is now stable.