Merge ~vpa1977/ubuntu/+source/procyon:java21-ftbfs into ubuntu/+source/procyon:ubuntu/devel

Proposed by Vladimir Petko
Status: Merged
Merge reported by: Vladimir Petko
Merged at revision: bba137646af8e9469865b0f4c0f0d4e4242dfac7
Proposed branch: ~vpa1977/ubuntu/+source/procyon:java21-ftbfs
Merge into: ubuntu/+source/procyon:ubuntu/devel
Diff against target: 139 lines (+107/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/03-java21-disable-failing-tests.patch (+96/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Canonical Foundations Team Pending
git-ubuntu import Pending
Review via email: mp+460738@code.launchpad.net

Description of the change

This MP resolves Java 21 ftbfs.

PPA: ppa:vpa1977/gettext [1]

Changes:
 - Disable tests that fail on Java 21. The decompiler still produces reasonable
   code, just not what the tests expect.

Testing:
 - rebuild in default Java 21 ppa[2]
 - piuparts test [3]

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext
[2] https://launchpad.net/~vpa1977/+archive/ubuntu/gettext-21/+sourcepub/15798883/+listing-archive-extra
[3] https://bugs.launchpad.net/ubuntu/+source/procyon/+bug/2054251/comments/1

To post a comment you must log in.

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 70a7006..ef249c8 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+procyon (0.6.0-1ubuntu1) noble; urgency=medium
7+
8+ * d/p/03-java21-disable-failing-tests.patch: disable tests failing
9+ with Java 21 (LP: #2054251). The decompiler still produces reasonable
10+ code, just not what the tests expect.
11+
12+ -- Vladimir Petko <vladimir.petko@canonical.com> Mon, 19 Feb 2024 11:55:04 +1300
13+
14 procyon (0.6.0-1) unstable; urgency=medium
15
16 New upstream release
17diff --git a/debian/control b/debian/control
18index 7592a06..cb175ef 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -1,7 +1,8 @@
22 Source: procyon
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: Emmanuel Bourg <ebourg@apache.org>
29 Build-Depends:
30 debhelper-compat (= 13),
31diff --git a/debian/patches/03-java21-disable-failing-tests.patch b/debian/patches/03-java21-disable-failing-tests.patch
32new file mode 100644
33index 0000000..e3fc36f
34--- /dev/null
35+++ b/debian/patches/03-java21-disable-failing-tests.patch
36@@ -0,0 +1,96 @@
37+Description: disable tests failing with Java 21
38+ - SwitchTests.testEnumSwitch - enum switch was decompiled as an ordinal switch.
39+ - ThirdPartyTests.testUnboxToNumber - decompiled code contains Constable,
40+ not Number.
41+ - ThirdPartyTests.testLiteralAssignments - test specifies float numbers with
42+ excess precision, Java truncates those since 19.
43+ - ThirdPartyTests.testOptimizedVariables, testSwitchKrakatau,
44+ testWhileLoopsKrakatau - decompiled variable does not match ('b' vs 'x')
45+Author: Vladimir Petko <vladimir.petko@canonical.com>
46+Bug: https://github.com/mstrobel/procyon/issues/71
47+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057532
48+Bug-Ubuntu: https://bugs.launchpad.net/debian/+source/procyon/+bug/2054251
49+Last-Update: 2024-02-02
50+--- a/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/DecompilerTest.java
51++++ b/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/DecompilerTest.java
52+@@ -157,4 +157,14 @@
53+
54+ return CompilerTarget.DEFAULT;
55+ }
56++
57++ protected static boolean specificationVersionLessThan21() {
58++ try {
59++ return Integer.parseInt(System.getProperty("java.specification.version")) < 21 ;
60++ }
61++ catch (NumberFormatException e) {
62++ // will fail for 1.8 earlier
63++ }
64++ return true;
65++ }
66+ }
67+--- a/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/SwitchTests.java
68++++ b/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/SwitchTests.java
69+@@ -13,6 +13,7 @@
70+
71+ package com.strobel.decompiler;
72+
73++import org.junit.Assume;
74+ import org.junit.Test;
75+
76+ public class SwitchTests extends DecompilerTest {
77+@@ -254,6 +255,8 @@
78+
79+ @Test
80+ public void testEnumSwitch() {
81++ Assume.assumeTrue("Java 21: enum switch was decompiled as an ordinal switch",
82++ specificationVersionLessThan21());
83+ verifyOutput(
84+ SwitchTests$D.class,
85+ createSettings(OPTION_EXCLUDE_NESTED | OPTION_FLATTEN_SWITCH_BLOCKS),
86+--- a/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/ThirdPartyTests.java
87++++ b/Procyon.CompilerTools/src/test/java/com/strobel/decompiler/ThirdPartyTests.java
88+@@ -20,6 +20,8 @@
89+
90+ @Test
91+ public void testOptimizedVariables() throws Throwable {
92++ Assume.assumeTrue("Java 21: decompiled variable does not match ('b' vs 'x')",
93++ specificationVersionLessThan21());
94+ assumePreJdk9();
95+ verifyOutput(
96+ Class.forName("SootOptimizationTest"),
97+@@ -97,6 +99,8 @@
98+
99+ @Test
100+ public void testSwitchKrakatau() throws Throwable {
101++ Assume.assumeTrue("Java 21: decompiled variable does not match ('b' vs 'x')",
102++ specificationVersionLessThan21());
103+ assumePreJdk9();
104+ verifyOutput(
105+ Class.forName("Switch"),
106+@@ -147,6 +151,8 @@
107+
108+ @Test
109+ public void testWhileLoopsKrakatau() throws Throwable {
110++ Assume.assumeTrue("Java 21: decompiled variable does not match ('b' vs 'x')",
111++ specificationVersionLessThan21());
112+ assumePreJdk9();
113+ verifyOutput(
114+ Class.forName("WhileLoops"),
115+@@ -283,6 +289,8 @@
116+
117+ @Test
118+ public void testUnboxToNumber() throws Throwable {
119++ Assume.assumeTrue("Java 21: decompiled code contains Constable, not Number",
120++ specificationVersionLessThan21());
121+ assumePreJdk9();
122+ verifyOutput(
123+ Class.forName("UnboxToNumber"),
124+@@ -307,6 +315,8 @@
125+
126+ @Test
127+ public void testLiteralAssignments() {
128++ Assume.assumeTrue("Java 21 truncates floats specified with excess precision",
129++ specificationVersionLessThan21());
130+ verifyOutput(
131+ "LiteralAssignments",
132+ defaultSettings(),
133diff --git a/debian/patches/series b/debian/patches/series
134index 481a8ee..fee79c2 100644
135--- a/debian/patches/series
136+++ b/debian/patches/series
137@@ -1 +1,2 @@
138 02-cli-program-name.patch
139+03-java21-disable-failing-tests.patch

Subscribers

People subscribed via source and target branches