Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353981 - javatoolkit rewrites build.xml incorrectly
Summary: javatoolkit rewrites build.xml incorrectly
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-07 17:16 UTC by Joe H
Modified: 2020-08-03 10:22 UTC (History)
2 users (show)

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


Attachments
Broken build.xml after rewrite (build.xml,23.28 KB, application/xml)
2011-02-07 17:18 UTC, Joe H
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe H 2011-02-07 17:16:23 UTC
When trying to emerge any ant-related packages, and it gets to the point of rewriting the build.xml file, the resulting build.xml file is invalid, containing \x00 bytes at every other character.

Initially, I ran into the problem while emerging ant-core-1.8.1, and got around it by commenting out the doRewrite() calls in /usr/lib64/javatoolkit/bin/xml-rewrite-3.py.  However, now I'm seeing the same behavior while emerging commons-logging-1.1.1.  Snippet from emerge output:

>>> Emerging (1 of 30) dev-java/commons-logging-1.1.1
 * commons-logging-1.1.1-src.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                                      [ ok ]
 * Package:    dev-java/commons-logging-1.1.1
 * Repository: gentoo
 * Maintainer: java@gentoo.org
 * USE:  amd64 elibc_glibc kernel_linux multilib userland_GNU
 * Using: sun-jdk-1.5
>>> Unpacking source...
>>> Unpacking commons-logging-1.1.1-src.tar.gz to /var/tmp/portage/dev-java/commons-logging-1.1.1/work
tar: A lone zero block at 1830
 * Applying commons-logging-1.1.1-gentoo.patch ...                                                                                                       [ ok ]
 * Applying commons-logging-1.1.1-servletapi.patch ...                                                                                                   [ ok ]
Changing ignoresystemclasses to true for available tasks in build.xml
Rewriting build.xml
>>> Source unpacked in /var/tmp/portage/dev-java/commons-logging-1.1.1/work
>>> Compiling source in /var/tmp/portage/dev-java/commons-logging-1.1.1/work/commons-logging-1.1.1-src ...
 * Disabling all optional ANT_TASKS
Buildfile: /var/tmp/portage/dev-java/commons-logging-1.1.1/work/commons-logging-1.1.1-src/build.xml

BUILD FAILED
/var/tmp/portage/dev-java/commons-logging-1.1.1/work/commons-logging-1.1.1-src/build.xml:2: Element type "p" must be followed by either attribute specifications, ">" or "/>".

The build.xml file looks like:

$ head /var/tmp/portage/dev-java/commons-logging-1.1.1/work/commons-logging-1.1.1-src/build.xml -n2
<?xml version="1.0" encoding="UTF-8"?>
<proj na="Logg" base="." defa="al" >

The output looks odd because of the \x00 bytes:

$ hexdump -C /var/tmp/portage/dev-java/commons-logging-1.1.1/work/commons-logging-1.1.1-src/build.xml | head
00000000  3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31  |<?xml version="1|
00000010  2e 30 22 20 65 6e 63 6f  64 69 6e 67 3d 22 55 54  |.0" encoding="UT|
00000020  46 2d 38 22 3f 3e 0a 3c  70 00 72 00 6f 00 6a 20  |F-8"?>.<p.r.o.j |
00000030  6e 00 61 00 3d 22 4c 00  6f 00 67 00 67 22 20 62  |n.a.="L.o.g.g" b|
00000040  00 61 00 73 00 65 3d 22  2e 22 20 64 00 65 00 66  |.a.s.e="." d.e.f|
00000050  00 61 3d 22 61 00 6c 22  20 3e 0a 0a 0a 0a 0a 0a  |.a="a.l" >......|
00000060  20 00 3c 70 00 72 00 6f  00 70 00 20 66 00 69 00  | .<p.r.o.p. f.i.|
00000070  3d 22 62 00 75 00 69 00  6c 00 64 00 2e 00 70 00  |="b.u.i.l.d...p.|
00000080  72 00 22 20 3e 3c 2f 70  00 72 00 6f 00 70 00 3e  |r." ></p.r.o.p.>|
00000090  20 00 20 00 20 00 20 00  20 00 20 00 20 00 20 00  | . . . . . . . .|

Running "ebuild .. prepare" on the commons-logging ebuild file results in the already-broken build.xml file.

I've tried re-emerging pyxml, javatoolkit, and have run python-updater -- none of which has resolved the issue.


# emerge --info
Portage 2.1.9.25 (default/linux/amd64/10.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-hardened-r7 x86_64)
=================================================================
System uname: Linux-2.6.23-hardened-r7-x86_64-Intel-R-_Xeon-R-_CPU_E5310_@_1.60GHz-with-gentoo-1.12.11.1
Timestamp of tree: Fri, 04 Feb 2011 06:30:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11
dev-lang/python:     2.4.4-r5, 2.5.4-r2, 2.6.6-r1, 3.1.2-r1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2::<unknown repository>, 1.10.1, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.1.2
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81::<unknown repository>
virtual/os-headers:  2.6.23-r3 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/src/godin-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline session sse sse2 ssl sysfs tcpd unicode xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

# eselect python list
Available Python interpreters:
  [1]   python2.4
  [2]   python2.5
  [3]   python2.6 *
  [4]   python3.1

# eselect java-vm list
Available Java Virtual Machines:
  [1]   sun-jdk-1.5  system-vm
  [2]   sun-jdk-1.6 
  [3]   sun-jre-bin-1.6 

(note: I've also tried sun-jdk-1.6)
Comment 1 Joe H 2011-02-07 17:18:10 UTC
Created attachment 261743 [details]
Broken build.xml after rewrite

This is an example of the broken build.xml file
Comment 2 Rafał Mużyło 2011-02-07 20:35:30 UTC
Looks as if parts of it were converted to utf16.
Does '/usr/lib/javatoolkit/bin/xml-rewrite-2.py -f build.xml --change -e available -a ignoresystemclasses -v "true"' have the same effect ?

And a trick question: does  *unmerging* pyxml help ?

Comment 3 Joe H 2011-02-08 02:38:50 UTC
> Does '/usr/lib/javatoolkit/bin/xml-rewrite-2.py -f build.xml --change -e
> available -a ignoresystemclasses -v "true"' have the same effect ?

Yes:
# /usr/lib/javatoolkit/bin/xml-rewrite-2.py -f build.xml --change -e available -a ignoresystemclasses -v "true" 
Rewriting build.xml
# head -n2 build.xml 
<?xml version="1.0" encoding="UTF-8"?>
<proj na="apach" base="." defa="ma" >

> And a trick question: does  *unmerging* pyxml help ?

Yes..

# emerge -pv --depclean pyxml
Calculating dependencies... done!
  dev-python/pyxml-0.8.4-r2 pulled in by:
    dev-java/javatoolkit-0.3.0-r4
# emerge -C pyxml
...
# ebuild ant-core-1.8.1.ebuild prepare
...
# cd <workspace>

# /usr/lib/javatoolkit/bin/xml-rewrite-2.py -f build.xml --change -e available -a ignoresystemclasses -v "true"
Rewriting build.xml
# head -n2 build.xml 
<?xml version="1.0" encoding="UTF-8"?>
<proj na="apach" base="." defa="ma" >
Comment 4 Joe H 2011-02-08 02:39:41 UTC
>> And a trick question: does  *unmerging* pyxml help ?
> Yes..

Sorry .. correction:  Yes, same problem;  no, does not help :x
Comment 5 Joe H 2011-02-08 02:41:24 UTC
Also, with pyxml unmerged, the same happens with xml-rewrite-3.py as well:

# /usr/lib/javatoolkit/bin/xml-rewrite-3.py -f build.xml --change -e available -a ignoresystemclasses -v "true"
Rewriting build.xml
# head -n2 build.xml 
<?xml version="1.0" encoding="UTF-8"?>
<proj na="apach" base="." defa="ma" >
Comment 6 Rafał Mużyło 2011-02-08 02:47:07 UTC
Does i.e. LANG=en_US.utf8 help ?
Comment 7 Joe H 2011-02-08 02:54:06 UTC
(In reply to comment #6)
> Does i.e. LANG=en_US.utf8 help ?

No:

# LANG=en_US.utf8 /usr/lib/javatoolkit/bin/xml-rewrite-3.py -f build.xml --change -e available -a ignoresystemclasses -v "true"
Rewriting build.xml
# head -n2 build.xml 
<?xml version="1.0" encoding="UTF-8"?>
<proj na="apach" base="." defa="ma" >

(also, note I am running 'ebuild .. clean' before each 'ebuild .. prepare', and verify that build.xml looks proper after ebuild prepare)

Possibly worth noting:  before the rewrite, build.xml has no encoding=* attribute in the <?xml tag, but adding one does not help either.
Comment 8 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2011-02-08 16:43:45 UTC
what's the output of 'locale' command ?
Comment 9 Joe H 2011-02-09 00:43:21 UTC
(In reply to comment #8)
> what's the output of 'locale' command ?

# locale 
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
Comment 10 Joe H 2011-02-09 00:59:30 UTC
I've since created /etc/env.d/02locale with LC_CTYPE="en_US.utf8", created /etc/locale.gen with "en_US" and "en_US.UTF-8" and run locale-gen, env-update, source /etc/profile, and new output of "locale" is:

# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

However, file is still rewritten improperly.