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

Proposed by Vladimir Petko
Status: Merged
Merged at revision: 61b066239685719a1281b8b94cf27ceda4b44853
Proposed branch: ~vpa1977/ubuntu/+source/jruby:jruby-ftbfs
Merge into: ubuntu/+source/jruby:ubuntu/devel
Diff against target: 121 lines (+50/-4)
6 files modified
debian/changelog (+12/-0)
debian/control (+2/-1)
debian/patches/0014-jruby-8081-invert-o-nonblock-flag.patch (+26/-0)
debian/patches/series (+1/-0)
debian/rules (+6/-0)
debian/tests/control (+3/-3)
Reviewer Review Type Date Requested Status
Pushkar Kulkarni (community) Approve
git-ubuntu import Pending
Review via email: mp+461172@code.launchpad.net

Description of the change

This MR addresses jruby build and autopkgtest issues.

ppa: ppa:vpa1977/plusone [1]

Changes:
 - copy POM files so that maven-install-plugin could update them
 - mark mri-extra, spec-ruby, mri-stdlib as flaky
 - d/p/jruby-8081-invert-o-nonblock-flag.patch: apply upstream patch
   to fix fcntl call O_NONBLOCK semantics (it was inverted)

Testing:
 - build in ppa with -proposed enabled[2]
 - rebuild jruby against itself[3]
 - autopkgtests
  - jruby/9.4.5.0+ds-1ubuntu1~ppa3
    + ✅ jruby on noble for amd64 @ 26.02.24 21:52:17 Log️ 🗒️ [4]
    + ✅ jruby on noble for armhf @ 26.02.24 20:17:06 Log️ 🗒️ [5]
    + ✅ jruby on noble for i386 @ 26.02.24 20:15:19 Log️ 🗒️ [6]
    + ✅ jruby on noble for ppc64el @ 26.02.24 20:18:34 Log️ 🗒️ [7]
    + ✅ jruby on noble for s390x @ 26.02.24 20:14:51 Log️ 🗒️ [8]

arm64 timed out, but not considered a regression.

 - test setting pipes to blocking (see comment)

[1] https://launchpad.net/~vpa1977/+archive/ubuntu/plusone/+packages
[2] https://launchpad.net/~vpa1977/+archive/ubuntu/plusone/+sourcepub/15818671/+listing-archive-extra
[3] https://launchpad.net/~vpa1977/+archive/ubuntu/plusone-rebuild/+build/27821466
[4] https://autopkgtest.ubuntu.com/results/autopkgtest-noble-vpa1977-plusone/noble/amd64/j/jruby/20240226_215217_e9afd@/log.gz
[5] https://autopkgtest.ubuntu.com/results/autopkgtest-noble-vpa1977-plusone/noble/armhf/j/jruby/20240226_201706_7dfaf@/log.gz
[6] https://autopkgtest.ubuntu.com/results/autopkgtest-noble-vpa1977-plusone/noble/i386/j/jruby/20240226_201519_b2258@/log.gz
[7] https://autopkgtest.ubuntu.com/results/autopkgtest-noble-vpa1977-plusone/noble/ppc64el/j/jruby/20240226_201834_c5095@/log.gz
[8] https://autopkgtest.ubuntu.com/results/autopkgtest-noble-vpa1977-plusone/noble/s390x/j/jruby/20240226_201451_1aacb@/log.gz

To post a comment you must log in.
Revision history for this message
Vladimir Petko (vpa1977) wrote :

captureRuby.rb
---
require 'open3'
require 'fcntl'

if defined? JRUBY_VERSION
  puts "JRuby #{JRUBY_VERSION}, Java #{java.lang.System.getProperty('java.version')}"
else
  puts "CRuby #{RUBY_VERSION}"
end

read, write = IO.pipe
flags = write.fcntl(Fcntl::F_GETFL)
# set nonblocking flag so that ruby knows about it
write.fcntl(Fcntl::F_SETFL, flags | (Fcntl::O_NONBLOCK)) # actually clears
# clear nonblocking flag
write.fcntl(Fcntl::F_SETFL, flags & (~Fcntl::O_NONBLOCK)) # set nonblock flag

pid = spawn("./printFlags.py", :out => write)

write.close
puts "Manual spawn: #{read.read}"
Process.wait pid
---

printFlags.py
------
#!/usr/bin/env python3

import fcntl
import os
import sys

def decode_flags(flags):
    flags_to_check = {
        "O_RDONLY": os.O_RDONLY,
        "O_WRONLY": os.O_WRONLY,
        "O_RDWR": os.O_RDWR,
        "O_APPEND": os.O_APPEND,
        "O_NONBLOCK": os.O_NONBLOCK,
    }

    result = []
    for name, flag in flags_to_check.items():
        if flags & flag:
            result.append(name)
            flags &= ~flag

    if flags:
        result.append(str(flags))

    return "+".join(result)

stdout_io_flags = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
print(f"stdout io flags: {stdout_io_flags} == {decode_flags(stdout_io_flags)}")
----

$jruby capturePython.rb
JRuby 9.4.5.0, Java 21.0.2
Manual spawn: stdout io flags: 1 == O_WRONLY

The output shows that the flag was successfully cleared.

Revision history for this message
Pushkar Kulkarni (pushkarnk) :
review: Approve
Revision history for this message
Vladimir Petko (vpa1977) wrote :

Uploaded, thank you for review!!!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 7b51e87..e8434d8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
1jruby (9.4.5.0+ds-1ubuntu1) noble; urgency=medium
2
3 * d/rules: copy jruby pom files so that they can by updated by
4 maven-install-plugin. Fixes ftbfs (LP: #2054942).
5 * d/t/control: mark mri-extra, spec-ruby, mri-stdlib as flaky. See
6 launchpad bug 2054943.
7 * d/p/jruby-8081-invert-o-nonblock-flag.patch: apply upstream patch
8 to fix fcntl call. This allows workaround for launchpad
9 bug 2054943.
10
11 -- Vladimir Petko <vladimir.petko@canonical.com> Mon, 26 Feb 2024 11:55:18 +1300
12
1jruby (9.4.5.0+ds-1) unstable; urgency=medium13jruby (9.4.5.0+ds-1) unstable; urgency=medium
214
3 * Rebuild for unstable.15 * Rebuild for unstable.
diff --git a/debian/control b/debian/control
index 21e0097..2ba7e82 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: jruby1Source: jruby
2Section: ruby2Section: ruby
3Priority: optional3Priority: optional
4Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
5Uploaders:6Uploaders:
6 Thomas Goirand <zigo@debian.org>,7 Thomas Goirand <zigo@debian.org>,
7 Jérôme Charaoui <jerome@riseup.net>,8 Jérôme Charaoui <jerome@riseup.net>,
diff --git a/debian/patches/0014-jruby-8081-invert-o-nonblock-flag.patch b/debian/patches/0014-jruby-8081-invert-o-nonblock-flag.patch
8new file mode 1006449new file mode 100644
index 0000000..f6c99e8
--- /dev/null
+++ b/debian/patches/0014-jruby-8081-invert-o-nonblock-flag.patch
@@ -0,0 +1,26 @@
1Description: Invert this logic to match O_NONBLOCK flag
2 The blocking behaviour was opposite of what O_NONBLOCK flag
3 indicates.
4Author: Charles Oliver Nutter <headius@headius.com>
5Origin: upstream, https://github.com/jruby/jruby/commit/40a43760fddccdc9b5ca636680fc75a08d6a0d49
6Bug: https://github.com/jruby/jruby/issues/8081
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/jruby/+bug/2054943
8Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064786
9Applied-Upstream: commit, 40a43760fddccdc9b5ca636680fc75a08d6a0d49
10Last-Update: 2024-02-26
11diff --git a/core/src/main/java/org/jruby/RubyIO.java b/core/src/main/java/org/jruby/RubyIO.java
12index 115c259279..144660fe82 100644
13--- a/core/src/main/java/org/jruby/RubyIO.java
14+++ b/core/src/main/java/org/jruby/RubyIO.java
15@@ -2619,9 +2619,9 @@ public class RubyIO extends RubyObject implements IOEncodable, Closeable, Flusha
16 return runtime.newFixnum(close_on_exec_p(context).isTrue() ? FD_CLOEXEC : 0);
17 } else if (realCmd == Fcntl.F_SETFL.intValue()) {
18 if ((nArg & OpenFlags.O_NONBLOCK.intValue()) != 0) {
19- fptr.setBlocking(runtime, true);
20- } else {
21 fptr.setBlocking(runtime, false);
22+ } else {
23+ fptr.setBlocking(runtime, true);
24 }
25
26 if ((nArg & OpenFlags.O_CLOEXEC.intValue()) != 0) {
diff --git a/debian/patches/series b/debian/patches/series
index dedc44d..ec9db73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
90012-Fix-test-failures-related-to-Module-PTY.patch90012-Fix-test-failures-related-to-Module-PTY.patch
100013-Work-around-JarResourceTest-failure.patch100013-Work-around-JarResourceTest-failure.patch
11Update-to-use-non-expired-certificates.patch11Update-to-use-non-expired-certificates.patch
120014-jruby-8081-invert-o-nonblock-flag.patch
diff --git a/debian/rules b/debian/rules
index 7f9bd55..112c7ad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,6 +38,12 @@ execute_after_dh_auto_configure:
38 mv rubygems debian/maven-repo38 mv rubygems debian/maven-repo
39 # backup upstream generated poms39 # backup upstream generated poms
40 $(foreach p,. lib core shaded,cp ${p}/pom.xml ${p}/pom.xml.bak;)40 $(foreach p,. lib core shaded,cp ${p}/pom.xml ${p}/pom.xml.bak;)
41 # copy jruby poms rather than links, because the build will try to patch them
42 for p in jruby jruby-parent jruby-base jruby-core jruby-artifacts ; do \
43 rm debian/maven-repo/org/jruby/$$p/* ;\
44 mkdir debian/maven-repo/org/jruby/$$p/debian ; \
45 cp /usr/share/maven-repo/org/jruby/$$p/debian/* debian/maven-repo/org/jruby/$$p/debian/ ;\
46 done
4147
42override_dh_auto_build:48override_dh_auto_build:
43 dh_auto_build -- -Djruby.revision=$(DEB_VERSION) -Pmain,complete,dist49 dh_auto_build -- -Djruby.revision=$(DEB_VERSION) -Pmain,complete,dist
diff --git a/debian/tests/control b/debian/tests/control
index 5d26b4d..4fa7fdb 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -112,7 +112,7 @@ Depends:
112 ruby-rspec,112 ruby-rspec,
113 ruby-test-unit,113 ruby-test-unit,
114 @,114 @,
115Restrictions: allow-stderr115Restrictions: allow-stderr, flaky
116Architecture: amd64, arm64116Architecture: amd64, arm64
117117
118Tests: mri-core118Tests: mri-core
@@ -140,7 +140,7 @@ Depends:
140 ruby-rspec,140 ruby-rspec,
141 ruby-test-unit,141 ruby-test-unit,
142 @,142 @,
143Restrictions: allow-stderr143Restrictions: allow-stderr, flaky
144Architecture: amd64, arm64144Architecture: amd64, arm64
145145
146Tests: mri-stdlib146Tests: mri-stdlib
@@ -154,5 +154,5 @@ Depends:
154 ruby-rspec,154 ruby-rspec,
155 ruby-test-unit,155 ruby-test-unit,
156 @,156 @,
157Restrictions: allow-stderr157Restrictions: allow-stderr, flaky
158Architecture: amd64, arm64158Architecture: amd64, arm64

Subscribers

People subscribed via source and target branches