| Summary: | dev-java/asm-2.2.3 compile fails in SerialVersionUIDAdder.java with a 1.4 JDK | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Howard B. Golden <howard_b_golden> |
| Component: | Current packages | Assignee: | Java team <java> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | derk.tebokkel, fordfrog, th_veith |
| Priority: | High | ||
| Version: | 2006.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
asm-2.2.3.ebuild.patch
asm-2.2.3.ebuild patch for building 1.4 bytecode |
||
public UnsupportedOperationException(Throwable cause) - Since: 1.5 nasty I've tried setting the system Java to sun-jdk-1.5, but the ebuild still grabs aaand uses blackdown-jdk-1.4.2 and throws the exact same errors (even after env-update && source /etc/profile) With new java system, system vm is no longer the VM used to emerge. Read http://www.gentoo.org/doc/en/java.xml#doc_chap4_sect3 to see how to set build VM. Created attachment 98206 [details, diff]
asm-2.2.3.ebuild.patch
I've corrected jdk in DEPEND to 1.5 - patch.
Fixed in CVS. Thanks for reporting! Doing this will break groovy when you try to build it with 1.4 JDK (bytecode problem). Here's one possible solutions to problems like this. The problem are packages that need some parts 1.5+ API but the source itself is fine with 1.4. If we build them with 1.5 bytecode, we need to make sure everything that depends on it is 1.5 bytecode as well. That's a lot of room for breakage. By building them with 1.4 bytecode, most depending stuff will build against it fine (maybe except for some corner cases when ebuild A extends a 1.5+ class and ebuild B tries to extend this class from A, then 1.4 JDK used for ebuild B would probably fail). Then there's potential runtime breakage when something tries to execute parts of the code that need 1.5+, but for that you specify that runtime VM is jre 1.5 and java launcher should ensure that anything that's using this library will run with 1.5 jre. So the solution for such ebuilds probably is: - use DEPEND=">=jdk-1.5" so you have a JDK capable of building it - override DEPEND checking for source and target with JAVA_PKG_WANT_SOURCE=1.4 and JAVA_PKG_WANT_TARGET=1.4 - use RDEPEND=">=jre-1.5" that will translate in VM=">=jre-1.5" in package.env and java launcher should pick this up and choose a 1.5 JRE to run (not sure if it does now, but it should) Now, the problem is with JAVA_PKG_WANT_SOURCE=1.4 and JAVA_PKG_WANT_TARGET=1.4. sun-javamail already uses this solution, but in fact it doesn't work. It allows you to override SOURCE, but TARGET is left at 1.5. sun-javamail is fine because there source and target is set to 1.4 in upstream build.xml and no rewriting happens, but it doesn't work in general. I believe the problem is in java-utils-2.eclass function java-pkg_get-target() which has some kind of sanity checks that don't allow you to set TARGET lower than the JDK version specified in DEPEND. But as I've just explained, it makes perfect sense to set it lower. RFC :) Created attachment 98328 [details, diff]
asm-2.2.3.ebuild patch for building 1.4 bytecode
wrt to bug #153971, think this bug can be closed *** This bug has been marked as a duplicate of 153971 *** |
While emerging dev-java/asm-2.2.3, the following messages appear: [javac] Compiling 109 source files to /var/tmp/portage/asm-2.2.3/work/asm-2.2.3/output/build/tmp [javac] /var/tmp/portage/asm-2.2.3/work/asm-2.2.3/src/org/objectweb/asm/commons/SerialVersionUIDAdder.java:434: cannot resolve symbol [javac] symbol : constructor UnsupportedOperationException (java.lang.Exception) [javac] location: class java.lang.UnsupportedOperationException [javac] throw new UnsupportedOperationException(e); [javac] ^ [javac] 1 error Build environment: GENTOO_VM=blackdown-jdk-1.4.2 CLASSPATH="" JAVA_HOME="/opt/blackdown-jdk-1.4.2.03" JAVACFLAGS="-source 1.4 -target 1.4" COMPILER="javac" emerge --info Portage 2.1.2_pre1-r1 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-gentoo-r8 i686) ================================================================= System uname: 2.6.17-gentoo-r8 i686 AMD Athlon(tm) XP 2200+ Gentoo Base System version 1.12.5 Last Sync: Sat, 23 Sep 2006 19:00:08 +0000 ccache version 2.4 [enabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-java/java-config: 1.3.7, 2.0.30 dev-lang/python: 2.3.5-r2, 2.4.3-r3 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 dev-util/confcache: 0.4.2-r1 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.13-r3 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /opt/jetty/etc /opt/openjms/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/bind /var/qmail/alias /var/qmail/control /var/service /var/spool/fax/etc /var/vpopmail/domains /var/vpopmail/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=athlon-xp -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="http://gentoo.llarian.net/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" 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" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowext X X509 a52 aac acpi alsa amd ansi apache2 apm arts artswrappersuid artworkextra asf bcmath berkdb bitmap-fonts browserplugin bzip2 c++ cairo calendar caps cdda cddb cdf cdparanoia chroot cjk clamav cli cln cpudetection crypt css ctype cups curl curlwrappers dba dbase dbus dbx dio directfb djbfft dlloader dnd doc dri dv dvd dvdr dvdread dvi dynagraph ecc eds elibc_glibc emacs emboss encode erandom esd evo examples exif fastcgi fbcon fdftk ffmpeg fftw firefox flac flatfile font-server foomaticdb fortran ftp gb gcj gcl gd gdbm gif ginac glep gmp gnome gnomedb gnuplot gnustep gnutls gpm gprof graphviz gstreamer gtk gtk2 hal haskell iconv icq idea idl idn imagemagick imap imlib inifile innodb input_devices_keyboard input_devices_mouse insecure-drivers ipv6 isdnlog ithreads jabber java java5 javacomm javamail javascript jce jms jpeg junit jython kde kdeenablefinal kdepim kdexdeltas kerberos kernel_linux kexi kqemu latex ldap leim libclamav libg++ libgda libwww lids live lm_sensors log4j ltsp mad maildir mailwrapper math mbox mdb memlimit mikmod mime mmap mmx motif mozdevelop mozilla moznoirc moznomail mozsha1 mozsvg mozxmlterm mp3 mpeg mpi mplayer mysql ncurses netboot nls nptl nptlonly nsplugin oav objc ocaml odbc ofx ogg openexr opengl oss pam parse-clocks patented pcntl pcre pda pdf perl pg-hier pg-intdatetime php pic plotutils png posix postgres ppds pppd prelude pwdb python pyzor qdbm qemu-fast qmail qt3 qt4 quicktime rdesktop readline reflection rhino rss ruby samba sasl sdk sdl session sguil sharedmem simplexml skey slp soap sockets socks5 source spell spl sql sqlite sqlite3 sse ssl subversion svg svga syslog sysvipc t1lib tcltk tcpd tetex theora threads tidy tiff tk tokenizer toolbar truetype truetype-fonts type1 type1-fonts udev unicode usb userland_GNU utf8 verbose vhosts video_cards_ati video_cards_fbdev video_cards_radeon video_cards_vesa vorbis wddx webdav win32codecs winbind wxwindows xemacs xine xml xmlreader xmlrpc xmlwriter xmms xorg xpm xsl xslt xv xvmc yahoo yv12 zip zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS