Merge ~hyask/ubuntu/+source/beets:skia/fix_s390x_autopkgtest_ubuntu into ubuntu/+source/beets:ubuntu/devel

Proposed by Skia
Status: Merged
Approved by: Andreas Hasenack
Approved revision: 0c7cd05e477e2fc57eb6d46db54eab6145bfc3cc
Merged at revision: 0c7cd05e477e2fc57eb6d46db54eab6145bfc3cc
Proposed branch: ~hyask/ubuntu/+source/beets:skia/fix_s390x_autopkgtest_ubuntu
Merge into: ubuntu/+source/beets:ubuntu/devel
Diff against target: 120 lines (+86/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/fix-ubuntu-s390x (+76/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Andreas Hasenack Approve
Ubuntu Sponsors Pending
Review via email: mp+483930@code.launchpad.net

Description of the change

This is a bugfix only patch, to allow the package to migrate from -proposed. This isn't seeded anywhere, so shouldn't be of much trouble regarding the upcoming Plucky release.

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I don't understand yet what is going on.

This is a noarch build, so all builds happen on amd64. The failure is in the build tests, which are also run again as dep8 tests.

I'm first checking the current version in the archive, without this patch.

In a plucky PPA, the amd64 build skips the problematic test, because:

  SKIPPED [1] test/plugins/test_thumbnails.py:263: GIO library not found

If I build it locally in an amd64 lxd, though, the test isn't skipped, and passes.

If I build it in an s390x lxd, the test is not skipped, but fails.

So first I'm trying to understand why the ppa build is different, and what makes GIO not be found there.

Revision history for this message
Skia (hyask) wrote :

There, as requested, I've opened bug 2106276 to document the case, and updated the changelog accordingly.

I didn't try to build directly in an s390x container, so didn't encounter that weird mismatch during the build. The only thing I see is that the test is skipped during the build on amd64, indeed because GIO isn't there, but the test is never skipped during dep8 run, and now always passes on all architectures (with the fix).

autopkgtest results on all arches: https://autopkgtest.ubuntu.com/user/hyask/ppa/beets

Revision history for this message
Paride Legovini (paride) wrote :

@Andreas probably the LXD container you built in is not as minimal as a PPA chroot? I tried starting a fresh lxd container locally and it has libglib2.0-0t64 preinstalled (which is the library providing gio). Even containers built using minimal images have that library installed.

Look like LP or git-ubuntu are broken right now (I can't `git ubuntu clone`), so I can't review/test locally, but this LGTM.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I purged libglib2.0-0t64 from the s390x container, and built beets again. It runs the unit tests during build, and then I can see the skipped test:

test/plugins/test_thumbnails.py .......s. [ 557/1797]
...
SKIPPED [1] test/plugins/test_thumbnails.py:263: GIO library not found

Revision history for this message
Andreas Hasenack (ahasenack) :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Download full text (6.8 KiB)

I'm now getting this build/test error on s390x (I did reinstall libglib2.0-0t64):

FAILED test/plugins/test_permissions.py::PermissionsPluginTest::test_failing_to_set_permissions
= 1 failed, 1691 passed, 97 skipped, 1 deselected, 9 xfailed, 1 warning in 39.64s =
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /home/ubuntu/git/packages/beets/beets/.pybuild/cpython3_3.13/build; python3.13 -m pytest -k "not test_completion"
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.13 returned exit code 13

In more detail:
____________ PermissionsPluginTest.test_failing_to_set_permissions _____________

self = <test.plugins.test_permissions.PermissionsPluginTest testMethod=test_failing_to_set_permissions>

    @patch("os.chmod", Mock())
    def test_failing_to_set_permissions(self):
> self.do_thing(False)

test/plugins/test_permissions.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/plugins/test_permissions.py:60: in do_thing
    self.assertPerms(item.path, "file", expect_success)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
                                                                                                                                     ...

Read more...

Revision history for this message
Skia (hyask) wrote (last edit ):

Thanks for getting back to this. When you mention "always a PPA build to try", you mean a PPA with only s390x enabled to get a build on s390x specifically? Otherwise I already pushed that to a PPA and triggered autopkgtest for all architectures:
* PPA: https://launchpad.net/~hyask/+archive/ubuntu/beets
* autopkgtest: https://autopkgtest.ubuntu.com/user/hyask/ppa/beets

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> you mean a PPA with only s390x enabled to get a build on s390x specifically?

Yeah, as I got that other test error in a lxd. But it built fine in the ppa.

Upstream approved it, and I have no other objections/comments. +1

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Let me know if you need sponsoring.

Revision history for this message
Skia (hyask) wrote :

Thanks for the review, and yes, I do need sponsoring. :-)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded:

Uploading beets_2.2.0-2ubuntu1.dsc
Uploading beets_2.2.0-2ubuntu1.debian.tar.xz
Uploading beets_2.2.0-2ubuntu1_source.buildinfo
Uploading beets_2.2.0-2ubuntu1_source.changes

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 0cddbc8..9e3acd4 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+beets (2.2.0-2ubuntu1) plucky; urgency=medium
7+
8+ * Patch: plugins/thumbnails: fix FFI with GIO on s390x.
9+ LP: #2106276
10+
11+ -- Florent 'Skia' Jacquet <florent.jacquet@canonical.com> Fri, 04 Apr 2025 17:50:13 +0200
12+
13 beets (2.2.0-2) unstable; urgency=medium
14
15 * Patch: Don't use 2025 as a "future" year. (Closes: #1091495)
16diff --git a/debian/control b/debian/control
17index f64a5b2..640bae0 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,7 +1,8 @@
21 Source: beets
22 Section: sound
23 Priority: optional
24-Maintainer: Debian Python Team <team+python@tracker.debian.org>
25+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
26+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
27 Uploaders:
28 Stefano Rivera <stefanor@debian.org>,
29 Ryan Kavanagh <rak@debian.org>
30diff --git a/debian/patches/fix-ubuntu-s390x b/debian/patches/fix-ubuntu-s390x
31new file mode 100644
32index 0000000..f0ae961
33--- /dev/null
34+++ b/debian/patches/fix-ubuntu-s390x
35@@ -0,0 +1,76 @@
36+From: Florent 'Skia' Jacquet <skia@hya.sk>
37+Date: Fri, 4 Apr 2025 17:16:16 +0200
38+Subject: plugins/thumbnails: fix FFI with GIO on s390x
39+
40+Using the correct function signature for g_file_new_for_path fixes the
41+tests on s390x.
42+I do not have the full story on why this failed consistently only on
43+s390x, but I guess the big endian might have something to play with
44+this.
45+
46+Here is how the tests were failing:
47+```
48+169s ___________________________ ThumbnailsTest.test_uri ____________________________
49+169s
50+169s self = <test.plugins.test_thumbnails.ThumbnailsTest testMethod=test_uri>
51+169s
52+169s def test_uri(self):
53+169s gio = GioURI()
54+169s if not gio.available:
55+169s self.skipTest("GIO library not found")
56+169s
57+169s > assert gio.uri("/foo") == "file:///" # silent fail
58+169s E AssertionError: assert '' == 'file:///'
59+169s E
60+169s E - file:///
61+169s
62+169s test/plugins/test_thumbnails.py:268: AssertionError
63+```
64+You can see a full log here [1] and a history of consistent failure
65+here [2]. Both links are bound to expire at some point, sorry future
66+archeologist 🤷.
67+
68+[1]: https://autopkgtest.ubuntu.com/results/autopkgtest-plucky/plucky/s390x/b/beets/20250403_162414_5d1da@/log.gz#S5
69+[2]: https://autopkgtest.ubuntu.com/packages/beets/plucky/s390x
70+
71+
72+Bug: LP: #2106276
73+Forwarded: https://github.com/beetbox/beets/pull/5708
74+Forwarded: https://salsa.debian.org/python-team/packages/beets/-/merge_requests/3
75+---
76+ beetsplug/thumbnails.py | 2 +-
77+ test/plugins/test_thumbnails.py | 5 ++++-
78+ 2 files changed, 5 insertions(+), 2 deletions(-)
79+
80+diff --git a/beetsplug/thumbnails.py b/beetsplug/thumbnails.py
81+index 3f88248e00d1..44ffd12defa1 100644
82+--- a/beetsplug/thumbnails.py
83++++ b/beetsplug/thumbnails.py
84+@@ -246,7 +246,7 @@ class GioURI(URIGetter):
85+ if self.available:
86+ self.libgio.g_type_init() # for glib < 2.36
87+
88+- self.libgio.g_file_get_uri.argtypes = [ctypes.c_char_p]
89++ self.libgio.g_file_new_for_path.argtypes = [ctypes.c_char_p]
90+ self.libgio.g_file_new_for_path.restype = ctypes.c_void_p
91+
92+ self.libgio.g_file_get_uri.argtypes = [ctypes.c_void_p]
93+diff --git a/test/plugins/test_thumbnails.py b/test/plugins/test_thumbnails.py
94+index 3eb36cd25732..00cd545d47f5 100644
95+--- a/test/plugins/test_thumbnails.py
96++++ b/test/plugins/test_thumbnails.py
97+@@ -265,7 +265,10 @@ class ThumbnailsTest(BeetsTestCase):
98+ if not gio.available:
99+ self.skipTest("GIO library not found")
100+
101+- assert gio.uri("/foo") == "file:///" # silent fail
102++ import ctypes
103++
104++ with pytest.raises(ctypes.ArgumentError):
105++ gio.uri("/foo")
106+ assert gio.uri(b"/foo") == "file:///foo"
107+ assert gio.uri(b"/foo!") == "file:///foo!"
108+ assert (
109+--
110+2.48.1
111+
112diff --git a/debian/patches/series b/debian/patches/series
113index 4e11c42..10041dd 100644
114--- a/debian/patches/series
115+++ b/debian/patches/series
116@@ -2,3 +2,4 @@ skip-broken-test
117 skip-unreliable-tests
118 test-rsrc
119 2025-future
120+fix-ubuntu-s390x

Subscribers

People subscribed via source and target branches

to all changes: