Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157031 - can't find suitable vm for >=virtual/jdk-1.5 with gcj-overlay
Summary: can't find suitable vm for >=virtual/jdk-1.5 with gcj-overlay
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-03 16:14 UTC by Maciej Piechotka
Modified: 2006-12-05 11:49 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Piechotka 2006-12-03 16:14:03 UTC
If I try to emerge anything with >=virtual/jdk-1.5 in deps:

>>> Emerging (1 of 1) dev-java/junit-4.1 to /
 * junit4.1.zip MD5 ;-) ...                                               [ ok ]
 * junit4.1.zip RMD160 ;-) ...                                            [ ok ]
 * junit4.1.zip SHA1 ;-) ...                                              [ ok ]
 * junit4.1.zip SHA256 ;-) ...                                            [ ok ]
 * junit4.1.zip size ;-) ...                                              [ ok ]
Traceback (most recent call last):
  File "/usr/bin/depend-java-query", line 85, in ?
    (options, args) = parser.parse_args()
  File "/usr/lib/python2.4/optparse.py", line 1277, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.4/optparse.py", line 1317, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.4/optparse.py", line 1392, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.4/optparse.py", line 709, in process
    return self.take_action(
  File "/usr/lib/python2.4/optparse.py", line 728, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/bin/depend-java-query", line 49, in get_vm
    vm = verman.get_vm(value)
  File "/usr/share/java-config-2/pym/java_config/VersionManager.py", line 131, in get_vm
    raise Exception("Couldn't find suitable VM. Possible invalid dependency string.")
Exception: Couldn't find suitable VM. Possible invalid dependency string.
 * Unable to determine VM for building from dependencies.
NV_DEPEND: >=virtual/jdk-1.5
        >=virtual/jre-1.5
        source? ( app-arch/zip )
        >=dev-java/ant-core-1.4
        app-arch/unzip  >=dev-java/java-config-2.0.19-r1 >=sys-apps/portage-2.1_pre1
        gcj? ( dev-java/gcj ) >=dev-java/javatoolkit-0.1.5 >=sys-apps/portage-2.1_pre1

Portage 2.1.2_rc2-r3 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18-no2 i686)
=================================================================
System uname: 2.6.18-no2 i686 Intel(R) Celeron(R) M processor         1.50GHz
Gentoo Base System version 1.12.6
Last Sync: Sun, 03 Dec 2006 02:30:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium-m -mmmx -msse -msse2 -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-Os -march=pentium-m -mmmx -msse -msse2 -mfpmath=sse -pipe -momit-leaf-frame-pointer -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug userfetch userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-O1"
LINGUAS="en_GB en_US pl"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/java-gcj-overlay /usr/portage/local/layman/java-experimental /usr/portage/local/layman/java-migration-packages /usr/portage/local/layman/ecatmur /usr/portage/local/layman/bmg /usr/portage/local/layman/initng /usr/portage/local/layman/gnome-experimental /usr/portage/local/layman/sunrise /usr/portage/local/layman/gentopia /usr/portage/local/layman/custom-kernels /usr/portage/local/layman/zugaina"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl acpi aiglx alsa avalon bash-completion beagle berkdb bitmap-fonts browseplugin bzip2 cairo calendar caps cddb cdparanoia cdr cli cracklib crypt cups curl curlwrappers dbus dlloader dri dvd dvdr eclipse eds elibc_glibc emacs emboss encode esd evolution exif expat fam ffmpeg firefox flac flash fortran fuse galago gcj gconf gdbm gif gimp glut gmail gnome gnutls gphoto2 gpm gstreamer gstreamer10 gtk gtk2 gtkhtml hal iconv imap input_devices_keyboard input_devices_mouse ipod iproute2 ipv6 isdnlog jabber java jpeg jpeg2k jython kernel_linux keyring libg++ libgda libnotify libsexy linguas_en_GB linguas_en_US linguas_pl logrotate lucene mad madwifi maildir mhash mikmod mmap mmx mono mozilla mp3 mpeg mule musicbrainz nautilus ncurses network networkmanager nfs nls nntp no-old-linux nptl nptlonly nsplugin ntpl ogg oggvorbis openal opengl pam pbm pcre pdf perl png pop postgres ppds pppd python quicktime readline reflection rhino ruby samba scanner sdl session soap sourceview spell spl sqlite sse sse2 ssh ssl subversion svg symlink tcpd tetex theora threads truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_radeon vorbis wifi xcomposite xml xml2 xorg xsl xulrunner xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-03 16:30:09 UTC
Post output of 'java-config -L', please
Comment 2 Maciej Piechotka 2006-12-03 16:39:42 UTC
% sudo java-config -L
Password:
The following VMs are available for generation-2:
1)      GCJ 4.1.1 [gcj-jdk-4.1]
*)      GCJ 4.2.0_alpha20061128 [gcj-jdk-4.2]

With >=virtual/jdk-1.4 is all ok
Comment 3 Josh Nichols (RETIRED) gentoo-dev 2006-12-03 17:24:28 UTC
Well, you only have gcj installed it seems. And gcj shouldn't, afaik, provide virtual/jdk. If you installed like sun-jdk-1.5, that should work... although, it's curious why the dependency wouldn't have been pulled in.
Comment 4 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-03 17:33:24 UTC
That's indeed strange. Any advice, geki?
Comment 5 Maciej Piechotka 2006-12-03 22:22:50 UTC
(In reply to comment #3)
> Well, you only have gcj installed it seems. And gcj shouldn't, afaik, provide
> virtual/jdk. If you installed like sun-jdk-1.5, that should work... although,
> it's curious why the dependency wouldn't have been pulled in.
> 

See java-gcj-overlay.
I have gcj & gcj-jdk installed and it works. Till yesterday. See http://forums.gentoo.org/viewtopic-t-379693-postdays-0-postorder-asc-start-0.html
(and I have a free like in freedom system).
Comment 6 Hanno Zysik (geki) 2006-12-03 23:43:24 UTC
Here is all fine, though ...

# emerge --oneshot junit -pv

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N    ] dev-java/sun-jdk-1.5.0.10  USE="X alsa nsplugin -doc -examples -jce" 48,393 kB [2] 
[ebuild     U ] dev-java/junit-4.2 [4.1] USE="gcj -doc -examples -source" 643 kB [2] 

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 49,035 kB
Portage overlays:
 [1] /usr/local/portage
 [2] /usr/local/gentoo-development/migrated-java-experimental-overlay
 [3] /usr/local/gentoo-development/gcj-overlay

# cat /etc/java-config-2/build/jdk.conf
...
#*=sun-jdk-1.5
*=gcj-jdk-4.2

shouldn't this use gcj-jdk for 1.5 stuff, too?
Seems I am not up to date with configuration. :)
Comment 7 Maciej Piechotka 2006-12-04 00:26:20 UTC
(In reply to comment #6)
> # cat /etc/java-config-2/build/jdk.conf
> ...
> #*=sun-jdk-1.5
> *=gcj-jdk-4.2
> 
> shouldn't this use gcj-jdk for 1.5 stuff, too?
> Seems I am not up to date with configuration. :)
> 

I have the same configuration. I used to successfully compile eclipse-sdk-3.2.x(without compiling java 1.5 binaries to bitcode) . Till now.
Comment 8 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-05 02:54:54 UTC
(In reply to comment #6)
> # cat /etc/java-config-2/build/jdk.conf
> ...
> #*=sun-jdk-1.5
> *=gcj-jdk-4.2
> 
> shouldn't this use gcj-jdk for 1.5 stuff, too?
> Seems I am not up to date with configuration. :)
> 

jdk.conf won't override the fact that gcj-jdk-4.2 doesn't report itself as 1.5 VM. You need to modify its env file in overlay's $FILESDIR to PROVIDES_VERSION="1.5" (and revbump to make sure people get that installed).
You should also copy virtual/jdk-1.5 from tree to the overlay and add gcj-jdk-4.2 as one of the alternatives (same thing you do with jdk-1.4.x) so that portage will pick it up in dep calculations and doesn't try to merge sun-jdk-1.5 or anything.
All assuming gcj-jdk-4.2 is really JDK-1.5 capable :)

That said, I still don't see why the original reported didn't get any 1.5 jdk installed by portage. Can you post the output of 'equery which =virtual/jdk-1.5*' (you need emerge gentoolkit to run this command) and then the contents of the file reported by this command?
Comment 9 Hanno Zysik (geki) 2006-12-05 03:35:43 UTC
(In reply to comment #8)
> jdk.conf won't override the fact that gcj-jdk-4.2 doesn't report itself as 1.5
> VM.

At some point you could force a 1.4 JDK for 1.5 depends with '*=bla'. It was possible through jdk.conf. So, at least the examples in it should be updated. Are they already? No idea how old my config file is.
Comment 10 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-05 03:53:34 UTC
(In reply to comment #9)
> At some point you could force a 1.4 JDK for 1.5 depends with '*=bla'. It was
> possible through jdk.conf. So, at least the examples in it should be updated.
> Are they already? No idea how old my config file is.

OK then maybe it does override after all (but then, uzytkownik probably doesn't have this set or he wouldn't get that error). What it certainly doesn't affect is the portage dep calculation, thus need for a overlayed virtual :)
Comment 11 Hanno Zysik (geki) 2006-12-05 04:07:57 UTC
It does not anymore. Like you see in my first post. It pulls in sun-jdk-1.5. Though, it should use gcj-jdk-4.2 by looking at my jdk.conf.

So, dep calc is just fine here.
I just say that the feature of jdk.conf does not work anymore.
I wonder what to set to force a jdk at build time now. jdk.conf used to be the config file for that. ;)
Comment 12 Maciej Piechotka 2006-12-05 05:07:17 UTC
When I change /usr/share/java-config-2/vm/gcj-jdk-4.2 it's works. It should be rather error "<name>-<version> not provides java <java-version>. Please, choose another" and breaks (it continues now).
Comment 13 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-05 05:24:21 UTC
(In reply to comment #11)
> It does not anymore. Like you see in my first post. It pulls in sun-jdk-1.5.
> Though, it should use gcj-jdk-4.2 by looking at my jdk.conf.

Portage doesn't know jdk.conf, it's not using for dep calculations, so it pulls what the DEPEND says (virtual/jdk-1.5+) and gcj-jdk-4.2 is not listed as the alternative there.

> So, dep calc is just fine here.

Yes, but not for uzytkownik... otherwise his java-config -L would list sun-jdk-1.5.

> I just say that the feature of jdk.conf does not work anymore.

jdk.conf never affected dependency pulling. It affects what will be chosen as build VM.

> I wonder what to set to force a jdk at build time now. jdk.conf used to be the
> config file for that. ;)

Set jdk.conf as usual. But you should change gcj-jdk-4.2's package.env to report as 1.5 JDK to be sure.
Comment 14 Maciej Piechotka 2006-12-05 05:29:53 UTC
About summary: Because gcj-jdk (ecj+gcj) do not support all of Java 5 - it's fine it marks an error. But it should be marked clearer (because on first time you don't know what's going on).
Comment 15 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-05 05:31:02 UTC
(In reply to comment #12)
> When I change /usr/share/java-config-2/vm/gcj-jdk-4.2 it's works. It should be
> rather error "<name>-<version> not provides java <java-version>. Please, choose

Yeah maybe the error message should be improved, to indicate that user's set in jdk.conf build VM isn't capable of what the ebuild needs. (and then try to find other capable one and eventually die if there isn't any).

Btw if you want a total override, there's JAVA_PKG_FORCE_VM env variable. But I wouldn't recommend that for global use, it's only for testing ebuilds.

> another" and breaks (it continues now).

It should die, it didn't? I was updating the java-utils-2.eclass to ensure it really dies. Maybe it wasn't merged to gcj-overlay?

And we still don't know why you didn't get a 1.5 jdk pulled :)
Comment 16 Maciej Piechotka 2006-12-05 05:38:43 UTC
I'm afraid it's gcj-overlay fault (overrides java-utils-2.eclass) I redirect it onto the forum
Comment 17 Hanno Zysik (geki) 2006-12-05 06:04:48 UTC
(In reply to comment #13)
> > I just say that the feature of jdk.conf does not work anymore.
> 
> jdk.conf never affected dependency pulling. It affects what will be chosen as
> build VM.

And exactly that does not happen which should with '*=bla'.
Comment 18 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-05 06:28:56 UTC
(In reply to comment #17)
> (In reply to comment #13)
> > > I just say that the feature of jdk.conf does not work anymore.
> > 
> > jdk.conf never affected dependency pulling. It affects what will be chosen as
> > build VM.
> 
> And exactly that does not happen which should with '*=bla'.

But it does! It's just meant to be a hint what to choose if there are multiple (valid!) choices. It's not meant as override of VM's capabilities specified in its env file (and gcj doesn't report itself as 1.5 JDK there). And I think it was always like this, you probably just never tried compiling something that needs 1.5 jdk with gcj?
Comment 19 Josh Nichols (RETIRED) gentoo-dev 2006-12-05 11:49:28 UTC
For the record, in jdk.conf

*=some-jdk

translates to 'Use some-jdk whenever possible'. So, if you had
*=sun-jdk-1.5

And you have something depend on =virtual/jdk-1.4*, it wouldn't be possible to use  sun-jdk-1.5, so would fall back on other settings / defaults.