Merge ~vpa1977/ubuntu/+source/antlr-maven-plugin:java21-ftbfs into ubuntu/+source/antlr-maven-plugin:ubuntu/devel

Proposed by Vladimir Petko
Status: Merged
Merged at revision: 553aa66f9e843fccd8f8ed1a8fdd987dd0eaa8b6
Proposed branch: ~vpa1977/ubuntu/+source/antlr-maven-plugin:java21-ftbfs
Merge into: ubuntu/+source/antlr-maven-plugin:ubuntu/devel
Diff against target: 67 lines (+34/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/security-manager.patch (+23/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Julian Andres Klode (community) Approve
git-ubuntu import Pending
Review via email: mp+460429@code.launchpad.net

Description of the change

This MP resolves Java 21 ftbfs.

PPA: ppa:vpa1977/gettext [1]

Changes:
 - add patch to catch UnsupportedOperationException.

Testing:
 - rebuild in default Java 21 ppa[2]
 - piuparts test [3]
Note:
 - the upstream for the plugin is no longer available (codehouse.org)
 - the plugin is still used by apache projects that are reverse build dependencies[1] and present in the archive[5]

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext
[2] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext-21/+sourcepub/15786613/+listing-archive-extra
[3] https://bugs.launchpad.net/ubuntu/+source/antlr-maven-plugin/+bug/2052993/comments/1
[4] https://github.com/apache/directory-ldap-api/blob/master/pom.xml#L271
[5] https://sources.debian.org/src/apache-directory-api/2.1.2-1/debian/control/#L10

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

Uploaded, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 61b9d40..5c3646b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+antlr-maven-plugin (2.2-5ubuntu1) noble; urgency=medium
7+
8+ * d/p/security-manager.patch: catch UnsupportedOperationException
9+ thrown by Java 21 setSecurityManager() method to resolve ftbfs
10+ (LP: #2052993).
11+
12+ -- Vladimir Petko <vladimir.petko@canonical.com> Tue, 13 Feb 2024 17:45:22 +1300
13+
14 antlr-maven-plugin (2.2-5) unstable; urgency=medium
15
16 * Fixed the build failure with doxia 1.11
17diff --git a/debian/control b/debian/control
18index d2c2ab1..0a8896e 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: antlr-maven-plugin
23 Section: java
24 Priority: optional
25-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
28 Uploaders:
29 Ludovic Claude <ludovic.claude@laposte.net>,
30 Torsten Werner <twerner@debian.org>,
31diff --git a/debian/patches/security-manager.patch b/debian/patches/security-manager.patch
32new file mode 100644
33index 0000000..4a2ad33
34--- /dev/null
35+++ b/debian/patches/security-manager.patch
36@@ -0,0 +1,23 @@
37+Description: catch SecurityManager exception
38+ When Java 21 is called without -Djava.security.manager property,
39+ UnsupportedOperationException is thrown in setSecurityManager() method.
40+ The plugin uses Security Manager to avoid shutting down Java machine on error,
41+ but gracefully handles situation when it can not be set.
42+ The patch is not forwarded as upstream is no longer available, but the
43+ plugin is still used by reverse build dependencies.
44+Author: Vladimir Petko <vladimir.petko@canonical.com>
45+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/antlr-maven-plugin/+bug/2052993
46+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053206
47+Forwarded: not-needed
48+Last-Update: 2024-02-13
49+--- a/src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java
50++++ b/src/main/java/org/codehaus/mojo/antlr/AbstractAntlrMojo.java
51+@@ -337,7 +337,7 @@
52+ oldSm = System.getSecurityManager();
53+ System.setSecurityManager( NoExitSecurityManager.INSTANCE );
54+ }
55+- catch ( SecurityException ex )
56++ catch ( UnsupportedOperationException | SecurityException ex )
57+ {
58+ // ANTLR-12
59+ oldSm = null;
60diff --git a/debian/patches/series b/debian/patches/series
61index ac07961..3d2a45d 100644
62--- a/debian/patches/series
63+++ b/debian/patches/series
64@@ -1,2 +1,3 @@
65 null-options-check.patch
66 modello-1.1.patch
67+security-manager.patch

Subscribers

People subscribed via source and target branches