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

Proposed by Vladimir Petko
Status: Merged
Merge reported by: Vladimir Petko
Merged at revision: ed2d421feb82960fa930f9506bdbe59fafec7261
Proposed branch: ~vpa1977/ubuntu/+source/metro-policy:java21-ftbfs
Merge into: ubuntu/+source/metro-policy:ubuntu/devel
Diff against target: 66 lines (+34/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/java21-stack-offset.patch (+24/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Canonical Foundations Team Pending
git-ubuntu import Pending
Review via email: mp+460736@code.launchpad.net

Description of the change

This MP resolves Java 21 ftbfs.

PPA: ppa:vpa1977/gettext [1]

Changes:
 - Apply proposed fix to resolve Java 21 test failures. Java 21 has a "shorter" stack trace so I've changed the function in line with the existing code for MacOS.

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
[3] https://bugs.launchpad.net/ubuntu/+source/metro-policy/+bug/2054245/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 d6afbc3..aad473f 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+metro-policy (2.7.2-3ubuntu1) noble; urgency=medium
7+
8+ * d/p/jaa21-stack-offset.patch: apply proposed fix to resolve Java 21
9+ test failures (LP: #2054245).
10+
11+ -- Vladimir Petko <vladimir.petko@canonical.com> Mon, 19 Feb 2024 11:01:08 +1300
12+
13 metro-policy (2.7.2-3) unstable; urgency=medium
14
15 * Removed the dependency on libactivation-java
16diff --git a/debian/control b/debian/control
17index 21227d0..46af1b2 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: metro-policy
22 Section: java
23 Priority: optional
24-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
27 Uploaders: Emmanuel Bourg <ebourg@apache.org>
28 Build-Depends:
29 debhelper (>= 11~),
30diff --git a/debian/patches/java21-stack-offset.patch b/debian/patches/java21-stack-offset.patch
31new file mode 100644
32index 0000000..1a9e8c0
33--- /dev/null
34+++ b/debian/patches/java21-stack-offset.patch
35@@ -0,0 +1,24 @@
36+Description: check for "invoke" in getCallerMethodName()
37+ Java 21 has same "shorter" stacktrace same as Mac OS X.
38+ The method name in the trace is "invoke" instead of "invoke0".
39+ This is a bit brittle, but since this approach is already used
40+ in the project, I have just updated the condition.
41+ Probably the better way would be to check the environment.
42+Author: Vladimir Petko <vladimir.petko@canonical.com>
43+Bug: https://github.com/eclipse-ee4j/metro-policy/pull/29
44+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057526
45+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/metro-policy/+bug/2054245
46+Last-Update: 2024-01-30
47+--- a/src/main/java/com/sun/xml/ws/policy/privateutil/PolicyUtils.java
48++++ b/src/main/java/com/sun/xml/ws/policy/privateutil/PolicyUtils.java
49+@@ -98,8 +98,8 @@
50+ */
51+ public static String getCallerMethodName() {
52+ String result = getStackMethodName(5);
53+- if (result.equals("invoke0")) {
54+- // We are likely running on Mac OS X, which returns a shorter stack trace
55++ if (result.equals("invoke0") || result.equals("invoke")) {
56++ // We are likely running on Mac OS X or Java 21, which returns a shorter stack trace
57+ result = getStackMethodName(4);
58+ }
59+ return result;
60diff --git a/debian/patches/series b/debian/patches/series
61new file mode 100644
62index 0000000..339ca04
63--- /dev/null
64+++ b/debian/patches/series
65@@ -0,0 +1 @@
66+java21-stack-offset.patch

Subscribers

People subscribed via source and target branches