Merge ~lucaskanashiro/ubuntu/+source/ruby2.7:fix-ftbfs into ubuntu/+source/ruby2.7:ubuntu/devel

Proposed by Lucas Kanashiro
Status: Merged
Approved by: Lucas Kanashiro
Approved revision: 50847ce8a7ff2e59b68da1b7df5cbdaf6b86ec56
Merged at revision: 50847ce8a7ff2e59b68da1b7df5cbdaf6b86ec56
Proposed branch: ~lucaskanashiro/ubuntu/+source/ruby2.7:fix-ftbfs
Merge into: ubuntu/+source/ruby2.7:ubuntu/devel
Diff against target: 274 lines (+246/-0)
4 files modified
debian/changelog (+8/-0)
debian/patches/0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch (+96/-0)
debian/patches/0011-Moved-not-implemented-method-tests-Bug-16662.patch (+139/-0)
debian/patches/series (+3/-0)
Reviewer Review Type Date Requested Status
Sergio Durigan Junior (community) Approve
Canonical Server Core Reviewers Pending
git-ubuntu developers Pending
Review via email: mp+391584@code.launchpad.net

Description of the change

Fix FTBFS with glibc 2.32. Backported a couple of upstream patches which fix the build failure.

Here is a PPA with the proposed package:

https://launchpad.net/~lucaskanashiro/+archive/ubuntu/groovy-ruby2.7

autopkgtest is happy:

autopkgtest [16:48:13]: @@@@@@@@@@@@@@@@@@@@ summary
run-all PASS
bundled-gems PASS
builtin-extensions PASS
rubyconfig PASS

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I'm reviewing this one.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

* Changelog:
  - [-] old content and logical tag match as expected
  - [√] changelog entry correct version and targeted codename
  - [√] changelog entries correct
  - [-] update-maintainer has been run

* Actual changes:
  - [-] no upstream changes to consider
  - [-] no further upstream version to consider
  - [√] debian changes look safe

* Build/Test:
  - [√] build is ok
  - [√] verified PPA package installs/uninstalls
  - [√] autopkgtest against the PPA package passes
  - [√] sanity checks test fine

The changes themselves look relatively fine, although I'm not a Ruby expert. I found it interesting that the first patch mentioned musl, even though we're fixing a problem due to a recent glibc :-).

I have a few small requests regarding the patches, but otherwise the MP is good to go IMO. For this reason, I'm marking it as Approved. Thanks!

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the review Sergio. I found upstream bug reports related to those patches and added them to the respective headers.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Waiting for FFe approval.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Turned out a FFe is not needed in this case. Uploaded:

$ git push pkg upload/2.7.1-3ubuntu1
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 8 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 4.08 KiB | 2.04 MiB/s, done.
Total 12 (delta 7), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/ruby2.7
 * [new tag] upload/2.7.1-3ubuntu1 -> upload/2.7.1-3ubuntu1

$ dput ubuntu ../ruby2.7_2.7.1-3ubuntu1_source.changes
Checking signature on .changes
gpg: ../ruby2.7_2.7.1-3ubuntu1_source.changes: Valid signature from F823A2729883C97C
Checking signature on .dsc
gpg: ../ruby2.7_2.7.1-3ubuntu1.dsc: Valid signature from F823A2729883C97C
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ruby2.7_2.7.1-3ubuntu1.dsc: done.
  Uploading ruby2.7_2.7.1-3ubuntu1.debian.tar.xz: done.
  Uploading ruby2.7_2.7.1-3ubuntu1_source.changes: done.
Successfully uploaded packages.

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 cfe37a4..95a7a47 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+ruby2.7 (2.7.1-3ubuntu1) groovy; urgency=medium
7+
8+ * Backport upstream patches to fix FTBFS with glibc 2.32 (LP: #1897895)
9+ - d/p/0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch
10+ - d/p/0011-Moved-not-implemented-method-tests-Bug-16662.patch
11+
12+ -- Lucas Kanashiro <lucas.kanashiro@canonical.com> Tue, 29 Sep 2020 16:07:54 -0300
13+
14 ruby2.7 (2.7.1-3build1) groovy; urgency=medium
15
16 * No-change rebuild against libffi8ubuntu1
17diff --git a/debian/patches/0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch b/debian/patches/0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch
18new file mode 100644
19index 0000000..262d2c8
20--- /dev/null
21+++ b/debian/patches/0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch
22@@ -0,0 +1,96 @@
23+From a19228f878d955eaf2cce086bcf53f46fdf894b9 Mon Sep 17 00:00:00 2001
24+From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
25+ <shyouhei@ruby-lang.org>
26+Date: Thu, 23 Jan 2020 15:33:42 +0900
27+Subject: [PATCH] brace the fact that lchmod(2) can EOPNOTSUPP
28+
29+Musl libc has this function as a tiny wrapper of fchmodat(3posix). On
30+the other hand Linux kernel does not support changing modes of a symlink.
31+The operation always fails with EOPNOTSUPP. This fchmodat behaviour is
32+defined in POSIX. We have to take care of such exceptions.
33+
34+Origin: upstream, https://github.com/ruby/ruby/commit/a19228f878
35+Bug-Upstream: https://bugs.ruby-lang.org/issues/16979
36+Reviewed-By: Lucas Kanashiro <kanashiro@ubuntu.com>
37+
38+---
39+ lib/fileutils.rb | 3 ++-
40+ test/pathname/test_pathname.rb | 2 +-
41+ test/ruby/test_notimp.rb | 19 ++++++++++++-------
42+ 3 files changed, 15 insertions(+), 9 deletions(-)
43+
44+diff --git a/lib/fileutils.rb b/lib/fileutils.rb
45+index a7ad65ae5e..04788e26ca 100644
46+--- a/lib/fileutils.rb
47++++ b/lib/fileutils.rb
48+@@ -1345,6 +1345,7 @@ def chmod(mode)
49+ else
50+ File.chmod mode, path()
51+ end
52++ rescue Errno::EOPNOTSUPP
53+ end
54+
55+ def chown(uid, gid)
56+@@ -1439,7 +1440,7 @@ def copy_metadata(path)
57+ if st.symlink?
58+ begin
59+ File.lchmod mode, path
60+- rescue NotImplementedError
61++ rescue NotImplementedError, Errno::EOPNOTSUPP
62+ end
63+ else
64+ File.chmod mode, path
65+diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
66+index 792510bdfb..2ce32a6c12 100644
67+--- a/test/pathname/test_pathname.rb
68++++ b/test/pathname/test_pathname.rb
69+@@ -818,7 +818,7 @@ def test_lchmod
70+ old = path.lstat.mode
71+ begin
72+ path.lchmod(0444)
73+- rescue NotImplementedError
74++ rescue NotImplementedError, Errno::EOPNOTSUPP
75+ next
76+ end
77+ assert_equal(0444, path.lstat.mode & 0777)
78+diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
79+index b069154cfc..e13db692b5 100644
80+--- a/test/ruby/test_notimp.rb
81++++ b/test/ruby/test_notimp.rb
82+@@ -13,11 +13,11 @@ def test_respond_to_fork
83+
84+ def test_respond_to_lchmod
85+ assert_include(File.methods, :lchmod)
86+- if /linux/ =~ RUBY_PLATFORM
87+- assert_equal(false, File.respond_to?(:lchmod))
88+- end
89+- if /freebsd/ =~ RUBY_PLATFORM
90++ case RUBY_PLATFORM
91++ when /freebsd/, /linux-musl/
92+ assert_equal(true, File.respond_to?(:lchmod))
93++ when /linux/
94++ assert_equal(false, File.respond_to?(:lchmod))
95+ end
96+ end
97+
98+@@ -57,9 +57,14 @@ def test_call_lchmod
99+ File.open(f, "w") {}
100+ File.symlink f, g
101+ newmode = 0444
102+- File.lchmod newmode, "#{d}/g"
103+- snew = File.lstat(g)
104+- assert_equal(newmode, snew.mode & 0777)
105++ begin
106++ File.lchmod newmode, "#{d}/g"
107++ rescue Errno::EOPNOTSUPP
108++ skip $!
109++ else
110++ snew = File.lstat(g)
111++ assert_equal(newmode, snew.mode & 0777)
112++ end
113+ }
114+ end
115+ end
116+--
117+2.25.1
118+
119diff --git a/debian/patches/0011-Moved-not-implemented-method-tests-Bug-16662.patch b/debian/patches/0011-Moved-not-implemented-method-tests-Bug-16662.patch
120new file mode 100644
121index 0000000..e7f778d
122--- /dev/null
123+++ b/debian/patches/0011-Moved-not-implemented-method-tests-Bug-16662.patch
124@@ -0,0 +1,139 @@
125+From 72c02aa4b79731c7f25c9267f74b347f1946c704 Mon Sep 17 00:00:00 2001
126+From: Nobuyoshi Nakada <nobu@ruby-lang.org>
127+Date: Fri, 28 Feb 2020 21:15:37 +0900
128+Subject: [PATCH] Moved not-implemented method tests [Bug #16662]
129+
130+Test not-implemented method with the dedicated methods, instead of
131+platform dependent features.
132+
133+Origin: upstream, https://github.com/ruby/ruby/commit/72c02aa4b79
134+Bug-Upstream: https://bugs.ruby-lang.org/issues/16662
135+Reviewed-By: Lucas Kanashiro <kanashiro@ubuntu.com>
136+
137+---
138+ test/-ext-/test_notimplement.rb | 7 +++
139+ test/ruby/test_notimp.rb | 90 ---------------------------------
140+ 2 files changed, 7 insertions(+), 90 deletions(-)
141+ delete mode 100644 test/ruby/test_notimp.rb
142+
143+diff --git a/test/-ext-/test_notimplement.rb b/test/-ext-/test_notimplement.rb
144+index 92a2fd22b8..038b507b73 100644
145+--- a/test/-ext-/test_notimplement.rb
146++++ b/test/-ext-/test_notimplement.rb
147+@@ -13,10 +13,17 @@ def test_funcall_notimplement
148+ end
149+
150+ def test_respond_to
151++ assert_include(Bug.methods(false), :notimplement)
152++ assert_include(Bug::NotImplement.instance_methods(false), :notimplement)
153+ assert_not_respond_to(Bug, :notimplement)
154+ assert_not_respond_to(Bug::NotImplement.new, :notimplement)
155+ end
156+
157++ def test_method_inspect_notimplement
158++ assert_match(/not-implemented/, Bug.method(:notimplement).inspect)
159++ assert_match(/not-implemented/, Bug::NotImplement.instance_method(:notimplement).inspect)
160++ end
161++
162+ def test_not_method_defined
163+ assert !Bug::NotImplement.method_defined?(:notimplement)
164+ assert !Bug::NotImplement.method_defined?(:notimplement, true)
165+diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
166+deleted file mode 100644
167+index e13db692b5..0000000000
168+--- a/test/ruby/test_notimp.rb
169++++ /dev/null
170+@@ -1,90 +0,0 @@
171+-# frozen_string_literal: false
172+-require 'test/unit'
173+-require 'timeout'
174+-require 'tmpdir'
175+-
176+-class TestNotImplement < Test::Unit::TestCase
177+- def test_respond_to_fork
178+- assert_include(Process.methods, :fork)
179+- if /linux/ =~ RUBY_PLATFORM
180+- assert_equal(true, Process.respond_to?(:fork))
181+- end
182+- end
183+-
184+- def test_respond_to_lchmod
185+- assert_include(File.methods, :lchmod)
186+- case RUBY_PLATFORM
187+- when /freebsd/, /linux-musl/
188+- assert_equal(true, File.respond_to?(:lchmod))
189+- when /linux/
190+- assert_equal(false, File.respond_to?(:lchmod))
191+- end
192+- end
193+-
194+- def test_call_fork
195+- GC.start
196+- pid = nil
197+- ps =
198+- case RUBY_PLATFORM
199+- when /linux/ # assume Linux Distribution uses procps
200+- proc {`ps -eLf #{pid}`}
201+- when /freebsd/
202+- proc {`ps -lH #{pid}`}
203+- when /darwin/
204+- proc {`ps -lM #{pid}`}
205+- else
206+- proc {`ps -l #{pid}`}
207+- end
208+- assert_nothing_raised(Timeout::Error, ps) do
209+- EnvUtil.timeout(20) {
210+- pid = fork {}
211+- Process.wait pid
212+- pid = nil
213+- }
214+- end
215+- ensure
216+- if pid
217+- Process.kill(:KILL, pid)
218+- Process.wait pid
219+- end
220+- end if Process.respond_to?(:fork)
221+-
222+- def test_call_lchmod
223+- if File.respond_to?(:lchmod)
224+- Dir.mktmpdir {|d|
225+- f = "#{d}/f"
226+- g = "#{d}/g"
227+- File.open(f, "w") {}
228+- File.symlink f, g
229+- newmode = 0444
230+- begin
231+- File.lchmod newmode, "#{d}/g"
232+- rescue Errno::EOPNOTSUPP
233+- skip $!
234+- else
235+- snew = File.lstat(g)
236+- assert_equal(newmode, snew.mode & 0777)
237+- end
238+- }
239+- end
240+- end
241+-
242+- def test_method_inspect_fork
243+- m = Process.method(:fork)
244+- if Process.respond_to?(:fork)
245+- assert_not_match(/not-implemented/, m.inspect)
246+- else
247+- assert_match(/not-implemented/, m.inspect)
248+- end
249+- end
250+-
251+- def test_method_inspect_lchmod
252+- m = File.method(:lchmod)
253+- if File.respond_to?(:lchmod)
254+- assert_not_match(/not-implemented/, m.inspect)
255+- else
256+- assert_match(/not-implemented/, m.inspect)
257+- end
258+- end
259+-
260+-end
261+--
262+2.25.1
263+
264diff --git a/debian/patches/series b/debian/patches/series
265index f56e37e..2f0d167 100644
266--- a/debian/patches/series
267+++ b/debian/patches/series
268@@ -7,3 +7,6 @@
269 0007-Port-to-kfreebsd-amd64.patch
270 0008-Fix-priority-order-of-paths-in-I-option.patch
271 0009-Fix-FTBFS-on-x32-misdetected-as-i386-or-amd64.patch
272+# glibc 2.32 fixes
273+0010-brace-the-fact-that-lchmod-2-can-EOPNOTSUPP.patch
274+0011-Moved-not-implemented-method-tests-Bug-16662.patch

Subscribers

People subscribed via source and target branches