Hello,
the next upstream release 1.10.6 did still not yet happen after some longer 
delay.
Last talked about end of January here:
https://mail-archives.apache.org/mod_mbox/ant-dev/201901.mbox/browser

After discussing on #debian-java with doko/tdaitx we propose to backport
the single fix mentioned here to add the missing compatibility with
openjdk11 to last packaged version.

Attached are 2 patches matching the 2 upstream commits to fix the issue:
https://gitbox.apache.org/repos/asf?p=ant.git;a=commit;h=593aff2d2ea52a025cfe7da32155216719029a7d
https://gitbox.apache.org/repos/asf?p=ant.git;a=commit;h=69269adced56238dc80297b9ae881442cd56259c

Note:
First patch is modified to remove the hunk to patch WHATSNEW file adding entry 
for this fix to 1.10.6 section. Remove as with the backport the whole entry for 
1.10.6 is not present being applied as backport on top of 1.10.5

We consider the fix safe as:
1.) Created by upstream planned to be release in next upstream version
2.) Conceptually simple fix:
- Detection of Java9 at runtime
- if present use newer API from openjdk which implements the real logic
- if not use existing API as before
The Multi-release awareness itself for the jar-file is coming from Openjdk code 
(present there since java9)
3.) New feature functionally only modifies behavior when jar file is a 
'multi-release jarfile' containing different byte-code targeting different Java 
versions at runtime.

We did the following tests:
a.) Based on current version in bionic-proposed:  1.10.5-2~18.04 
b.) Quilt imported both patches and rebuilt ant packages.
c.) In pristine bionic having bionic-proposed (and dist-upgrade ran)

Using our application (3rd party not available in Ubuntu) having custom
ant task using log4j2 (upstream multi-release jar file)

a.) Unpatched <=1.10.5 ant fails at runtime as it select java<=8 classfile 
version from jar imcompatible with openjdk11
- Patched 1.10.5 does work correctly without failing

b.) Testcase reported in this issue above works fine

c.) Run test-case upstream added along with the fix:
    ant/src/etc/testcases/core$ ant -f antclassloader.xml testMRJar

We repeated above tests using both openjdk-11 and openjdk-8 from bionic.


** Patch added: "bz-62952-support-mrjar-part1.diff"
   
https://bugs.launchpad.net/ubuntu/+source/ant/+bug/1808383/+attachment/5245933/+files/bz-62952-support-mrjar-part1.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1808383

Title:
  Java 9+ multi-release jars are not supported in ant tasks

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ant/+bug/1808383/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to