GNU bug report logs - #30050
[PATCH 0/2 core-updates] Fix antlr3 bootstrap toolchain to work on java8

Previous Next

Package: guix-patches;

Reported by: Gábor Boskovits <boskovits <at> gmail.com>

Date: Tue, 9 Jan 2018 20:04:03 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30050 in the body.
You can then email your comments to 30050 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#30050; Package guix-patches. (Tue, 09 Jan 2018 20:04:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gábor Boskovits <boskovits <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 09 Jan 2018 20:04:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Gábor Boskovits <boskovits <at> gmail.com>
Subject: [PATCH 0/2 core-updates] Fix antlr3 bootstrap toolchain to work on
 java8
Date: Tue,  9 Jan 2018 21:02:30 +0100
This patch series includes the fixes needed to bootstrap antlr3 for java8.
The toolchain includes two older versions of antlr3, which does not compile
on java8, because in java7 it was legal to pass null to removeAll, but this
is no longer so. Original behaviour was not to modify the object when null
is passed. java8 throws null pointer exception. Fix is simply to wrap the
call in a null check for the argument. This is backwards compatible.

Gábor Boskovits (2):
  gnu: antlr3-3.1: Fix java8 issue.
  gnu: antlr3-3.3: Fix java8 issue.

 gnu/local.mk                                       |  4 ++-
 gnu/packages/java.scm                              |  9 ++++--
 .../patches/antlr3-3_1-fix-java8-compilation.patch | 35 ++++++++++++++++++++++
 .../patches/antlr3-3_3-fix-java8-compilation.patch | 35 ++++++++++++++++++++++
 4 files changed, 80 insertions(+), 3 deletions(-)
 create mode 100644 gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch
 create mode 100644 gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch

-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#30050; Package guix-patches. (Tue, 09 Jan 2018 20:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 30050 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: 30050 <at> debbugs.gnu.org
Cc: Gábor Boskovits <boskovits <at> gmail.com>
Subject: [PATCH 1/2] gnu: antlr3-3.1: Fix java8 issue.
Date: Tue,  9 Jan 2018 21:10:08 +0100
* gnu/packages/java.scm (antlr3-3.1)[source]: Add patch.
* gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

In java8 it is an error to pass null to removeAll. Fix it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/java.scm                              |  4 ++-
 .../patches/antlr3-3_1-fix-java8-compilation.patch | 35 ++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8ed01eb2f..eb19acd59 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -541,6 +541,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/agg-am_c_prototype.patch			\
   %D%/packages/patches/ansible-wrap-program-hack.patch		\
   %D%/packages/patches/antiword-CVE-2014-8123.patch			\
+  %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch	\
   %D%/packages/patches/apr-skip-getservbyname-test.patch	\
   %D%/packages/patches/aspell-default-dict-dir.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 66db15389..1349906a9 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -5194,7 +5194,9 @@ import org.antlr.grammar.v2.ANTLRTreePrinter;"))
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))))
+                "0sfimc9cpbgrihz4giyygc8afgpma2c93yqpwb951giriri6x66z"))
+              (patches
+               (search-patches "antlr3-3_1-fix-java8-compilation.patch"))))
     (arguments
      `(#:jar-name (string-append ,name "-" ,version ".jar")
        #:source-dir "src:runtime/Java/src"
diff --git a/gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch b/gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch
new file mode 100644
index 000000000..0c4deb024
--- /dev/null
+++ b/gnu/packages/patches/antlr3-3_1-fix-java8-compilation.patch
@@ -0,0 +1,35 @@
+Based on the upstream fix for the java8 compilation issue.
+Simplified patch.
+Upstream version of patch does not work with this source tree.
+
+The issue is that in java8 it is an error to pass null to
+removeAll. Results in null pointer exception. java7
+behaviour was to return the list unmodified.
+
+From db2a350c6d90efaa8dde949fa76005c2c5af45c4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits <at> gmail.com>
+Date: Fri, 5 Jan 2018 17:05:31 +0100
+Subject: [PATCH] Fix java8 compilation.
+
+---
+ src/org/antlr/tool/CompositeGrammar.java | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/org/antlr/tool/CompositeGrammar.java b/src/org/antlr/tool/CompositeGrammar.java
+index f1408e7..7e02431 100644
+--- a/src/org/antlr/tool/CompositeGrammar.java
++++ b/src/org/antlr/tool/CompositeGrammar.java
+@@ -218,7 +218,9 @@ public class CompositeGrammar {
+ 	public List<Grammar> getIndirectDelegates(Grammar g) {
+ 		List<Grammar> direct = getDirectDelegates(g);
+ 		List<Grammar> delegates = getDelegates(g);
+-		delegates.removeAll(direct);
++		if (direct != null) {
++			delegates.removeAll(direct);
++		}
+ 		return delegates;
+ 	}
+ 
+-- 
+2.15.1
+
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#30050; Package guix-patches. (Tue, 09 Jan 2018 20:15:03 GMT) Full text and rfc822 format available.

Message #11 received at 30050 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: 30050 <at> debbugs.gnu.org
Cc: Gábor Boskovits <boskovits <at> gmail.com>
Subject: [PATCH 2/2] gnu: antlr3-3.3: Fix java8 issue.
Date: Tue,  9 Jan 2018 21:12:16 +0100
* gnu/packages/java.scm: Add missing copyright line.
* gnu/packages/java.scm (antlr3-3.3)[source]: Add patch.
* gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch: New file.
* gnu/local.mk: Update copyright line.
* gnu/local.mk (dist_patch_DATA): Add it.

In java8 it is an error to pass null to removeAll. Fix it.
---
 gnu/local.mk                                       |  3 +-
 gnu/packages/java.scm                              |  5 +++-
 .../patches/antlr3-3_3-fix-java8-compilation.patch | 35 ++++++++++++++++++++++
 3 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index eb19acd59..0c41bcd2a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -15,7 +15,7 @@
 # Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
 # Copyright © 2017 Clément Lassieur <clement <at> lassieur.org>
 # Copyright © 2017 Mathieu Othacehe <m.othacehe <at> gmail.com>
-# Copyright © 2017 Gábor Boskovits <boskovits <at> gmail.com>
+# Copyright © 2017, 2018 Gábor Boskovits <boskovits <at> gmail.com>
 #
 # This file is part of GNU Guix.
 #
@@ -542,6 +542,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ansible-wrap-program-hack.patch		\
   %D%/packages/patches/antiword-CVE-2014-8123.patch			\
   %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch	\
+  %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch	\
   %D%/packages/patches/apr-skip-getservbyname-test.patch	\
   %D%/packages/patches/aspell-default-dict-dir.patch		\
   %D%/packages/patches/ath9k-htc-firmware-binutils.patch	\
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 1349906a9..e1e9093df 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2017 Thomas Danckaert <post <at> thomasdanckaert.be>
 ;;; Copyright © 2016, 2017 Alex Vong <alexvong1995 <at> gmail.com>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2017, 2018 Gábor Boskovits <boskovits <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5103,7 +5104,9 @@ tree walking, and translation.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))))
+                "0qgg5vgsm4l1d6dj9pfbaa25dpv2ry2gny8ajy4vvgvfklw97b3m"))
+              (patches
+               (search-patches "antlr3-3_3-fix-java8-compilation.patch"))))
     (arguments
      `(#:jar-name (string-append ,name "-" ,version ".jar")
        #:source-dir (string-join '("tool/src/main/java"
diff --git a/gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch b/gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch
new file mode 100644
index 000000000..a7d6be9b6
--- /dev/null
+++ b/gnu/packages/patches/antlr3-3_3-fix-java8-compilation.patch
@@ -0,0 +1,35 @@
+Based on the upstream fix for the java8 compilation issue.
+Simplified patch.
+Upstream version of patch does not work with this source tree.
+
+The issue is that in java8 it is an error to pass null to
+removeAll. Results in null pointer exception. java7
+behaviour was to return the list unmodified.
+
+From 43867d50c05d1c06ab7220eb974a8874ae10c308 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits <at> gmail.com>
+Date: Fri, 5 Jan 2018 19:08:24 +0100
+Subject: [PATCH] Fix java8 complilation error.
+
+---
+ tool/src/main/java/org/antlr/tool/CompositeGrammar.java | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tool/src/main/java/org/antlr/tool/CompositeGrammar.java b/tool/src/main/java/org/antlr/tool/CompositeGrammar.java
+index f34ea73..63740a6 100644
+--- a/tool/src/main/java/org/antlr/tool/CompositeGrammar.java
++++ b/tool/src/main/java/org/antlr/tool/CompositeGrammar.java
+@@ -226,7 +226,9 @@ public class CompositeGrammar {
+ 	public List<Grammar> getIndirectDelegates(Grammar g) {
+ 		List<Grammar> direct = getDirectDelegates(g);
+ 		List<Grammar> delegates = getDelegates(g);
+-		delegates.removeAll(direct);
++		if(direct != null) {
++		        delegates.removeAll(direct);
++		}
+ 		return delegates;
+ 	}
+ 
+-- 
+2.15.1
+
-- 
2.15.1





Information forwarded to guix-patches <at> gnu.org:
bug#30050; Package guix-patches. (Sun, 04 Mar 2018 09:11:02 GMT) Full text and rfc822 format available.

Message #14 received at 30050 <at> debbugs.gnu.org (full text, mbox):

From: Gábor Boskovits <boskovits <at> gmail.com>
To: 30050 <at> debbugs.gnu.org
Subject: Please push this to master
Date: Sun, 4 Mar 2018 10:10:51 +0100
[Message part 1 (text/plain, inline)]
The original tag says this is a core-updates patch series, but since then
core-updates has been merged, so please push this to master.
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to 30050 <at> debbugs.gnu.org and Gábor Boskovits <boskovits <at> gmail.com> Request was from Danny Milosavljevic <dannym <at> scratchpost.org> to control <at> debbugs.gnu.org. (Sun, 04 Mar 2018 16:53:04 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#30050; Package guix-patches. (Sun, 04 Mar 2018 16:53:04 GMT) Full text and rfc822 format available.

Message #19 received at 30050-done <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: 30050-done <at> debbugs.gnu.org
Subject: Re: [bug#30050] [PATCH 0/2 core-updates] Fix antlr3 bootstrap
 toolchain to work on java8
Date: Sun, 4 Mar 2018 17:52:44 +0100
[Message part 1 (text/plain, inline)]
Hi Gábor,

thanks!

I've applied it to master.
[Message part 2 (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Apr 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.