Bug#895619: plexus-compiler: use --release instead of -source/-target for jdk9+ when setting defaults

2018-04-13 Thread Tiago Daitx
Please consider the attached debdiff for review.

On why it is important to use --release instead of the usual -source/-target:
any package that is not build with it can run into those
incompatibilities at runtime when run with an older (but targeted)
release. As a lot of libraries are being build with only
-source/-target set any package that depend on those won't run on
older (but targeted) jdk. It can also affect builds in case the
compiled tool is run during build time with the same old targeted jdk
- see bug #895234 where it was impossible to build
libcommons-lang3-java with openjdk-8 because bnd would fail. In fact,
for the affected packages (ie. use of flip()Ljava/nio/ByteBuffer),
since the build works but runtime fails the current scenario is the
same as setting -target 1.9.

This is already happening with the transition from openjdk-8 to 9 and,
although there's no such indication, it could also affect the
transition from 9/10 to 11 if they do similar changes to the JDK.

Another alternative to using --release is fixing the code that uses
the incompatible API, such as was done for gradle [1], but that does
not scale as well and it is reactive since errors are only detected
during runtime.

Regards,
Tiago

References:
[1] 
https://sources.debian.org/src/gradle/3.4.1-7/debian/patches/java8-compatibility.patch

On Fri, Apr 13, 2018 at 12:14 PM, Tiago Stürmer Daitx
<tiago.da...@canonical.com> wrote:
> Source: plexus-compiler
> Version: 2.8.2-5
> Severity: normal
>
> Dear Maintainer,
>
> plexus-compiler currently will default -source and/or -target to 1.7
> whenever the following occours:
> 1) whenever either has not being set
> 2) whenever either has been set to 1.6 or earlier
>
> This patch modifies the detection logic in order to be able to set the
> '--release' flag when (and only when):
> - the '--release' is *not* set
> - AND both -source and -target are being set to a default value
> - AND the running jvm is jdk9 or newer
>
> This prevents errors such as the infamous "Method
> flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer"
> that is caused by building with openjdk-9 with -source set without
> setting the proper bootclasspath [1,2]. JEP-247 [3] has provided the
> --release to prevent such issues and should be used instead of -source
> whenever the javac being used is jdk9 or higher.
>
>
> I have tested and I can confirm it works fine, but I would like some
> review to make sure it is sane and get opinions on other (better?) ways
> to do this - specially concerning the detection of the jvm being run.
>
> Also, fork and an alternative javac compiler might be set, thus I would
> like to discuss as to what behavior it should default it in that case.
>
> Regards,
> Tiago Daitx
>
> References:
> [1] https://bugs.launchpad.net/ubuntu/+source/gradle/+bug/1760359
> [2] https://github.com/plasma-umass/doppio/issues/497
> [3] http://openjdk.java.net/jeps/247
>
>
> -- System Information:
> Debian Release: buster/sid
>   APT prefers bionic
>   APT policy: (500, 'bionic'), (400, 'bionic-proposed')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 4.15.0-13-generic (SMP w/8 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_US (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled



-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE
diff -Nru plexus-compiler-2.8.2/debian/changelog plexus-compiler-2.8.2/debian/changelog
--- plexus-compiler-2.8.2/debian/changelog	2017-09-18 10:31:35.0 -0300
+++ plexus-compiler-2.8.2/debian/changelog	2018-04-12 11:35:44.0 -0300
@@ -1,3 +1,10 @@
+plexus-compiler (2.8.2-6~01) UNRELEASED; urgency=medium
+
+  * Use a default --release instead of defaults -source/-target in order to
+have the right bootclasspath set as per JEP 247. (Closes: #895619)
+
+ -- Tiago Stürmer Daitx <tiago.da...@ubuntu.com>  Thu, 12 Apr 2018 14:35:44 +
+
 plexus-compiler (2.8.2-5) unstable; urgency=medium
 
   * Team upload.
diff -Nru plexus-compiler-2.8.2/debian/patches/auto-adjust-language-level.patch plexus-compiler-2.8.2/debian/patches/auto-adjust-language-level.patch
--- plexus-compiler-2.8.2/debian/patches/auto-adjust-language-level.patch	2017-07-04 03:58:08.0 -0300
+++ plexus-compiler-2.8.2/debian/patches/auto-adjust-language-level.patch	2018-04-12 11:35:44.0 -0300
@@ -3,40 +3,81 @@
 Forwarded: not-needed
 --- a/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java
 +++ b/plexus-compilers/plexus-compiler-javac/src/main/java/org

Bug#895616: gradle: fix support for openjdk-9 --release flag

2018-04-13 Thread Tiago Daitx
Please consider the attached debdiff for fixing this bug.

thanks

-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE
diff -Nru gradle-3.4.1/debian/changelog gradle-3.4.1/debian/changelog
--- gradle-3.4.1/debian/changelog	2018-04-11 18:19:46.0 -0300
+++ gradle-3.4.1/debian/changelog	2018-04-12 18:01:31.0 -0300
@@ -1,3 +1,10 @@
+gradle (3.4.1-8) UNRELEASED; urgency=medium
+
+  * d/p/gnu-style-release-flag-jdk9.patch: Use GNU-style release flag for
+Java 9 compiler.
+
+ -- Tiago Stürmer Daitx   Thu, 12 Apr 2018 21:01:31 +
+
 gradle (3.4.1-7) unstable; urgency=medium
 
   * Team upload.
diff -Nru gradle-3.4.1/debian/patches/gnu-style-release-flag-jdk9.patch gradle-3.4.1/debian/patches/gnu-style-release-flag-jdk9.patch
--- gradle-3.4.1/debian/patches/gnu-style-release-flag-jdk9.patch	1969-12-31 21:00:00.0 -0300
+++ gradle-3.4.1/debian/patches/gnu-style-release-flag-jdk9.patch	2018-04-12 18:01:22.0 -0300
@@ -0,0 +1,97 @@
+Description: Use GNU-style release flag for Java 9 compiler
+ Since JDK 9 b135, only the new GNU-style option with double-dashes is
+ supported for the "--release" flag (see
+ https://bugs.openjdk.java.net/browse/JDK-8160851).
+Author: Yannick Welsch 
+Origin: upstream, https://github.com/gradle/gradle/commit/142f2f5233e77ba33146efe3815cd3b4b1245993
+Bug-Debian: https://bugs.debian.org/895616
+Forwarded: not-needed
+Applied-Upstream: https://github.com/gradle/gradle/commit/142f2f5233e77ba33146efe3815cd3b4b1245993
+Reviewed-by: Tiago Stürmer Daitx 
+Last-Update: 2018-04-12
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+From 142f2f5233e77ba33146efe3815cd3b4b1245993 Mon Sep 17 00:00:00 2001
+From: Yannick Welsch 
+Date: Mon, 17 Jul 2017 15:53:17 +0200
+Subject: [PATCH] Use GNU-style release flag for Java 9 compiler (#2474)
+
+Since JDK 9 b135, only the new GNU-style option with double-dashes is supported for the "--release" flag
+(see https://bugs.openjdk.java.net/browse/JDK-8160851).
+---
+ design-docs/jdk9-support.md | 6 +++---
+ .../api/internal/tasks/compile/JavaCompilerArgumentsBuilder.java| 2 +-
+ .../src/main/java/org/gradle/api/tasks/compile/CompileOptions.java  | 6 +++---
+ .../internal/tasks/compile/JavaCompilerArgumentsBuilderTest.groovy  | 6 +++---
+ .../org/gradle/java/compile/BasicJavaCompilerIntegrationSpec.groovy | 4 ++--
+ 5 files changed, 12 insertions(+), 12 deletions(-)
+
+
+--- a/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile/JavaCompilerArgumentsBuilder.java
 b/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile/JavaCompilerArgumentsBuilder.java
+@@ -227,7 +227,7 @@ public class JavaCompilerArgumentsBuilde
+ }
+ 
+ private boolean releaseOptionIsSet(List compilerArgs) {
+-return compilerArgs != null && compilerArgs.contains("-release");
++return compilerArgs != null && compilerArgs.contains("--release");
+ }
+ 
+ private void addClasspath() {
+--- a/subprojects/language-java/src/main/java/org/gradle/api/tasks/compile/CompileOptions.java
 b/subprojects/language-java/src/main/java/org/gradle/api/tasks/compile/CompileOptions.java
+@@ -315,10 +315,10 @@ public class CompileOptions extends Abst
+  * Defaults to the empty list.
+  *
+  * Compiler arguments not supported by the DSL can be added here. For example, it is possible
+- * to pass the {@code -release} option of JDK 9:
+- * compilerArgs.addAll(['-release', '7'])
++ * to pass the {@code --release} option of JDK 9:
++ * compilerArgs.addAll(['--release', '7'])
+  *
+- * Note that if {@code -release} is added then {@code -target} and {@code -source}
++ * Note that if {@code --release} is added then {@code -target} and {@code -source}
+  * are ignored.
+  */
+ @Input
+--- a/subprojects/language-java/src/test/groovy/org/gradle/api/internal/tasks/compile/JavaCompilerArgumentsBuilderTest.groovy
 b/subprojects/language-java/src/test/groovy/org/gradle/api/internal/tasks/compile/JavaCompilerArgumentsBuilderTest.groovy
+@@ -79,14 +79,14 @@ class JavaCompilerArgumentsBuilderTest e
+ builder.build() == ["-target", "1.4"] + defaultOptions
+ }
+ 
+-def "removes -source and -target option if -release is present"() {
++def "removes -source and -target option if --release is present"() {
+ when:
+-spec.compileOptions.compilerArgs += ['-release', '7']
++spec.compileOptions.compilerArgs += ['--release', '7']
+ spec.sourceCompatibility = '1.7'
+ spec.targetCompatibility = '1.7'
+ 
+ then:
+-builder.build() == defaultOptions + ['-release', '7']
++builder.build() == defaultOptions + 

Bug#895234: libcommons-lang3-java: update for OpenJDK 10 and OpenJDK 11

2018-04-12 Thread Tiago Daitx
This fix (or testing it) might be blocked by bug #895587.

-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE

__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Bug#895234: libcommons-lang3-java: update for OpenJDK 10 and OpenJDK 11

2018-04-12 Thread Tiago Daitx
> 1) libcommons-lang3-java must be rebuild using openjdk-9 with docs and
> tests disabled
Then install the resulting deb binary.

> 2) rebuild with openjdk-10, keep doc and tests disabled
Or maybe with just tests disabled, I might have run with docs disabled
just to get a binary a bit faster. Tests must be disabled because for
some reason surefire seems to embed those classes into it's own jars
instead of using them from libcommons-lang3-java (otherwise installing
the deb binary from step #1 should have fixed it). And then, again,
install the resulting deb binary.

> 3) rebuild surefire with the new libcommons-lang3-java
It might also require the tests to be disabled IIRC. And then install
the deb binary.

> 4) rebuild libcommons-lang3-java with openjdk-10 with tests and docs enabled 
> (just to be sure it works)

surefire needs to be rebuild after uploading the deb binary from step #4.

__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.


Bug#895583: libcommons-lang3-java FTBFS due to unsupported locale type

2018-04-12 Thread Tiago Daitx
A debdiff with the fix has been provided in bug #895234 [1].

thanks

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895234

On Fri, Apr 13, 2018 at 12:32 AM, Tiago Stürmer Daitx
 wrote:
> Package: libcommons-lang3-java
> Version: 3.5-1
> Severity: normal
>
> Dear Maintainer,
>
> With bug #895234 [1] fixed, libcommons-lang3-java will FTBFS as bellow:
>
> [INFO] Running org.apache.commons.lang3.LocaleUtilsTest
> [ERROR] Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 
> 0.007 s <<< FAILURE! - in org.apache.commons.lang3.LocaleUtilsTest
> [ERROR] testParseAllLocales(org.apache.commons.lang3.LocaleUtilsTest)  Time 
> elapsed: 0.004 s  <<< ERROR!
> java.lang.IllegalArgumentException: Invalid locale format: ji_001
> at 
> org.apache.commons.lang3.LocaleUtilsTest.testParseAllLocales(LocaleUtilsTest.java:578)
>
> Which has been fixed upstream by LANG-1312 [2]. The patch provided in
> the bug report applies cleanly.
>
> A debdiff will be provided shortly.
>
>
> References:
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895234
> [2] https://issues.apache.org/jira/browse/LANG-1312
>
> -- System Information:
> Debian Release: buster/sid
>   APT prefers bionic
>   APT policy: (500, 'bionic'), (400, 'bionic-proposed')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 4.15.0-13-generic (SMP w/8 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_US (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
>
> Versions of packages libcommons-lang3-java depends on:
> ii  libcommons-parent-java  43-1
>
> libcommons-lang3-java recommends no packages.
>
> Versions of packages libcommons-lang3-java suggests:
> pn  libcommons-lang3-java-doc  
>
> -- no debconf information



-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE

__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Bug#895234: libcommons-lang3-java: update for OpenJDK 10 and OpenJDK 11

2018-04-12 Thread Tiago Daitx
On Sun, 8 Apr 2018 19:03:14 +0200 Matthias Klose  wrote:
> Package: src:libcommons-lang3-java
> Version: 3.5-1
> Severity: important
> Tags: patch sid buster
>
> Please either apply the following patches for 10 and 11, or update to the
> upstream 3.6 release, and only apply the latter patch for 11 (which will be in
> 3.7 upstream).
>
> https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=commitdiff_plain;h=a618b844c5a261ced37385ab3947de6e215d46f7
>
> https://git-wip-us.apache.org/repos/asf?p=commons-lang.git;a=patch;h=50ce8c44e1601acffa39f5568f0fc140aade0564
>

After applying the openjdk-10 patch libcommons-lang3-java will FTBFS
due to a NullPointerException in the surefire plugin:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
(default-test) on project commons-lang3: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
(default-test) on project commons-lang3: Execution default-test of
goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test
failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:213)

at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution
default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:145)

at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: java.lang.NullPointerException
at 
org.apache.maven.surefire.shade.org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast
(SystemUtils.java:1626)


and then another FTBFS due to a failing locale test as reported in bug #895583.

The current bug also affects libmaven-javadoc-plugin-java.

In order to get the build working some additional steps are required
due to the circular runtime dependency between libcommons-lang3-java,
libmaven-javadoc-plugin-java (doc generation), and libsurefire-java
(tests):
1) libcommons-lang3-java must be rebuild using openjdk-9 with docs and
tests disabled
2) rebuild with openjdk-10, keep doc and tests disabled
3) rebuild surefire with the new libcommons-lang3-java
4) rebuild libcommons-lang3-java with openjdk-10

I believe it is easier to do a binary upload after the last step than
trying to get the builds to do that correctly. Note that it can't be
rebuild with openjdk-8 in step #1 due to a "Method
flip()Ljava/nio/ByteBuffer" error in bnd.

Hopefully I described all the required steps above without missing any
- I got sidetracked checking the openjdk-8 failure and testing the fix
in a few other packages, so it took me a while to remember everything
I had to run and install.

Please consider the attached debdiff as it fixes both this bug as well
as bug #895583.

thanks
Tiago
diff -Nru libcommons-lang3-java-3.5/debian/changelog libcommons-lang3-java-3.5/debian/changelog
--- libcommons-lang3-java-3.5/debian/changelog	2016-10-20 15:08:15.0 -0200
+++ libcommons-lang3-java-3.5/debian/changelog	2018-04-12 10:14:49.0 -0300
@@ -1,3 +1,16 @@
+libcommons-lang3-java (3.5-2) UNRELEASED; urgency=medium
+
+  * debian/patches/fix-openjdk-10-nullpointer-lang-1365.diff: calls to
+org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast cause
+NullPointerException when running under openjdk-10 which in turn causes
+other packages to FTBFS with the message "Execution default-cli of goal
+groupId:artifactId:version:jar failed.: NullPointerException -> [Help 1]".
+(Closes: #895234)
+  * debian/patches/fix-numeric-3-area-code-support-lang-1312.diff: pull
+upstream fix for numeric-3 area code support. (Closes: #895583)
+
+ -- Tiago Stürmer Daitx   Thu, 12 Apr 2018 13:14:49 +
+
 libcommons-lang3-java (3.5-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff
--- libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff	1969-12-31 21:00:00.0 -0300
+++ libcommons-lang3-java-3.5/debian/patches/fix-numeric-3-area-code-support-lang-1312.diff	2018-04-12 10:14:49.0 -0300
@@ -0,0 +1,65 @@
+Description: Fix UN M.49 numeric-3 area code support.
+ LocaleUtils#toLocale does not support language followed by UN M.49 numeric-3
+ area code. 
+Author: pascalschumacher 
+Origin: upstream, https://github.com/apache/commons-lang/pull/239
+Bug: https://issues.apache.org/jira/browse/LANG-1312
+Bug-Debian: https://bug.debian.org/

Bug#875336: FTBFS with Java 9: _ as identifier

2018-03-21 Thread Tiago Daitx
On Tue, 20 Mar 2018 23:07:13 +0800
=?UTF-8?B?5q635ZWf6IGwIHwgS2FpLUNodW5nIFlhbg==?= 
wrote:
> I just tried building it and Groovy was fine enough, but now Gradle 
> complains
>
> Theoretically, ALL Gradle packages FTBFS since the current version is too old 
> to play with Java 9's fancy version number.

Please take a look at the debdiff I attached to #873227 [1]. I would
like to get some feedback if it fixes these additional FTBFS.

[1] https://bugs.debian.org/873227

__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.


Bug#873227: Please upgrade to 4.1: Java 9 support

2018-03-21 Thread Tiago Daitx
Please see the attached debdiff to enable some basic OpenJDK 9 support
for gradle 3.4.1. The patches were downloaded from gradle upstream to
prevent the dreadful "Could not determine java version from '9.0.x'".

After applying the patches and rebuilding with OpenJDK 8, gradle can
then build itself with openjdk 9. I have also rebuild groovy, gant,
spock (FTBFS due to source/target 1.5), and dom4j (FTBFS due to
failing tests) which all previously failed.

Hopefully this should unblock #875336.

Please note that the debdiff includes the fix for #893487 for convenience.

thanks

On Fri, 25 Aug 2017 17:01:23 +0100 Chris West
 wrote:
> Source: gradle
> Version: 3.2.1-1
> Severity: normal
> User: debian-j...@lists.debian.org
> Usertags: default-java9
>
> Gradle doesn't officially support running under Java 9 until 4.1, which
> was released a fortnight ago.
>
> The version in Debian seems to actually be much better at surviving real
> builds than other random versions of Gradle I have lying around, but it
> would still be nice totally eliminate this as a java-9 blocker.
>
> Cheers,
> Chris.
>
>
>
diff -Nru gradle-3.4.1/debian/changelog gradle-3.4.1/debian/changelog
--- gradle-3.4.1/debian/changelog	2017-11-29 16:09:02.0 +0100
+++ gradle-3.4.1/debian/changelog	2018-03-19 12:19:49.0 +0100
@@ -1,3 +1,15 @@
+gradle (3.4.1-3) UNRELEASED; urgency=medium
+
+  * d/p/cast-estimated-runtime-to-long.patch: fix FTBFS due to missing cast.
+(Closes: #893487)
+  * d/p/support-running-gradle-on-jdk-10-500485df3a18.patch,
+d/p/add-test-case-for-10-internal_c1fe5e40a76b.patch,
+d/p/support-zulu9-version-number_d9c35cf9d74c.patch: prevent failures when
+building projects with openjdk 9.
+
+
+ -- Tiago Stürmer Daitx   Mon, 19 Mar 2018 11:19:49 +
+
 gradle (3.4.1-2) experimental; urgency=medium
 
   * Team upload.
diff -Nru gradle-3.4.1/debian/patches/add-test-case-for-10-internal_c1fe5e40a76b.patch gradle-3.4.1/debian/patches/add-test-case-for-10-internal_c1fe5e40a76b.patch
--- gradle-3.4.1/debian/patches/add-test-case-for-10-internal_c1fe5e40a76b.patch	1970-01-01 01:00:00.0 +0100
+++ gradle-3.4.1/debian/patches/add-test-case-for-10-internal_c1fe5e40a76b.patch	2018-03-19 12:19:49.0 +0100
@@ -0,0 +1,21 @@
+From c1fe5e40a76b79a98e8916c2ce3b4e1e6ed3f343 Mon Sep 17 00:00:00 2001
+From: Cedric Champeau 
+Date: Thu, 13 Jul 2017 16:16:46 +0200
+Subject: [PATCH] Add test case for `10-internal`
+
+---
+ .../base-services/src/test/groovy/org/gradle/api/JavaVersionSpec.groovy  | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/subprojects/base-services/src/test/groovy/org/gradle/api/JavaVersionSpec.groovy b/subprojects/base-services/src/test/groovy/org/gradle/api/JavaVersionSpec.groovy
+index 75459ed3f06..fbb243ba992 100644
+--- a/subprojects/base-services/src/test/groovy/org/gradle/api/JavaVersionSpec.groovy
 b/subprojects/base-services/src/test/groovy/org/gradle/api/JavaVersionSpec.groovy
+@@ -65,6 +65,7 @@ public class JavaVersionSpec extends Specification {
+ JavaVersion.toVersion("9-ea") == JavaVersion.VERSION_1_9
+ 
+ JavaVersion.toVersion("10-ea") == JavaVersion.VERSION_1_10
++JavaVersion.toVersion("10-internal") == JavaVersion.VERSION_1_10
+ }
+ 
+ def convertClassVersionToJavaVersion() {
diff -Nru gradle-3.4.1/debian/patches/cast-estimated-runtime-to-long.patch gradle-3.4.1/debian/patches/cast-estimated-runtime-to-long.patch
--- gradle-3.4.1/debian/patches/cast-estimated-runtime-to-long.patch	1970-01-01 01:00:00.0 +0100
+++ gradle-3.4.1/debian/patches/cast-estimated-runtime-to-long.patch	2018-03-19 12:15:47.0 +0100
@@ -0,0 +1,22 @@
+Description: gradle 3.4.1 FTBFS with a missing cast to long
+ estimatedRuntime must be cast to long otherwise gradle 3.4.1 FTBFS with
+ buildSrc/src/main/groovy/org/gradle/testing/DistributedPerformanceTest.groovy:
+ 134: [Static type checking] - Cannot assign value of type java.math.BigDecimal
+ to variable of type long.
+Author: Tiago Stürmer Daitx 
+Bug-Debian: https://bugs.debian.org/893487
+Forwarded: no
+Last-Update: 2018-03-19
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/buildSrc/src/main/groovy/org/gradle/testing/DistributedPerformanceTest.groovy
 b/buildSrc/src/main/groovy/org/gradle/testing/DistributedPerformanceTest.groovy
+@@ -131,7 +131,7 @@ class DistributedPerformanceTest extends
+ def scenarios = scenarioList.readLines()
+ .collect { line ->
+ def parts = Splitter.on(';').split(line).toList()
+-new Scenario(id : parts[0], estimatedRuntime: new BigDecimal(parts[1]), templates: parts.subList(2, parts.size()))
++new Scenario(id : parts[0], estimatedRuntime: new BigDecimal(parts[1]) as long, templates: parts.subList(2, parts.size()))
+ }
+ .sort{ 

Bug#892760: antlr3: FTBFS with Java 9

2018-03-14 Thread Tiago Daitx
I am attaching a simple fix to get rid of the FTBFS when building with
openjdk-9.

BTW, I didn't mention this before, but the reason that javadoc goals
worked with openjdk-8 is because openjdk-8's javadoc binary ignored
the missing packages/files instead of failing to run - the
documentation for the generated sources was never included.

thanks

-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE
diff -Nru antlr3-3.5.2/debian/changelog antlr3-3.5.2/debian/changelog
--- antlr3-3.5.2/debian/changelog	2017-08-02 11:53:56.0 +0200
+++ antlr3-3.5.2/debian/changelog	2018-03-14 15:21:31.0 +0100
@@ -1,3 +1,11 @@
+antlr3 (3.5.2-9) UNRELEASED; urgency=medium
+
+  * Add generate-sources to docs goals to activate antlr before javadoc's
+goals, otherwise javadoc:jar fails because the sourcepath is incomplete.
+(Closes: #892760)
+
+ -- Tiago Stürmer Daitx   Wed, 14 Mar 2018 14:21:31 +
+
 antlr3 (3.5.2-8) unstable; urgency=medium
 
   * Team upload.
diff -Nru antlr3-3.5.2/debian/rules antlr3-3.5.2/debian/rules
--- antlr3-3.5.2/debian/rules	2017-06-30 11:10:45.0 +0200
+++ antlr3-3.5.2/debian/rules	2018-03-14 15:20:48.0 +0100
@@ -8,7 +8,7 @@
 
 DEB_MAVEN_INSTALL_TO_USJ := false
 DEB_MAVEN_BUILD_TARGET := package install
-DEB_MAVEN_DOC_TARGET := javadoc:jar javadoc:aggregate
+DEB_MAVEN_DOC_TARGET := generate-sources javadoc:jar javadoc:aggregate
 PACKAGE  := $(DEB_SOURCE_PACKAGE)
 VERSION  := $(shell echo $(DEB_UPSTREAM_VERSION) | cut -d'+' -f1 -)
 JAVA_HOME:= /usr/lib/jvm/default-java
__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.

Bug#892760: antlr3: FTBFS with Java 9

2018-03-13 Thread Tiago Daitx
After reviewing this again I found out that the problem is caused by
the direct calling of javadoc's jar goal - note that this is specific
to cdbs, antlr4 relies on dh and calls the 3 goals "package
javadoc:jar javadoc:aggregate" together, which causes generate-sources
to be run before both javadoc goals.

When direct calling a goal, maven won't have a phase/lifecycle
associated to it, thus it won't activate any other plugins except for
the ones in the command line.

For antlr3 this causes a problem because javadoc:jar won't be able to
add the generated sources paths from antlr to javadoc's option
'sourcepath' as well as fail to properly accounting for the
org.antlr.gunit.swingui.parsers package.

Without the antlr3:antlr goal, javadoc:jar will set sourcepath as
'/build/antlr3/antlr3-3.5.2/gunit/src/main/java',
while if the antlr3:antlr goal is run before javadoc's goals the
sourcepath is set as
'/build/antlr3/antlr3-3.5.2/gunit/src/main/java:/build/antlr3/antlr3-3.5.2/gunit/target/generated-sources/antlr3'

And easy fix is to add generate-sources to the DEB_MAVEN_DOC_TARGET in
debian/rules, as such:
-DEB_MAVEN_DOC_TARGET := javadoc:jar javadoc:aggregate
+DEB_MAVEN_DOC_TARGET := generate-sources javadoc:jar javadoc:aggregate

thanks

-- 
Tiago Stürmer Daitx
Software Engineer
tiago.da...@canonical.com

PGP Key: 4096R/F5B213BE (hkp://keyserver.ubuntu.com)
Fingerprint = 45D0 FE5A 8109 1E91 866E  8CA4 1931 8D5E F5B2 13BE

__
This is the maintainer address of Debian's Java team
. 
Please use
debian-j...@lists.debian.org for discussions and questions.