Merge ~pushkarnk/ubuntu/+source/python-trio:fix-2054772 into ubuntu/+source/python-trio:ubuntu/devel

Proposed by Pushkar Kulkarni
Status: Merged
Merged at revision: 2dd3d8f79a0deddace915880d5e7fb8e38bb9725
Proposed branch: ~pushkarnk/ubuntu/+source/python-trio:fix-2054772
Merge into: ubuntu/+source/python-trio:ubuntu/devel
Diff against target: 75 lines (+43/-1)
4 files modified
debian/changelog (+8/-0)
debian/control (+2/-1)
debian/patches/0002-workaround-LP-test-failure.patch (+32/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Nick Rosbrook (community) Approve
Chris Peterson (community) Approve
Ubuntu Sponsors Pending
git-ubuntu import Pending
Review via email: mp+461337@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote (last edit ):

autopkgtests for python-trio pass

----
$ autopkgtest \
 --apt-upgrade \
 --shell-fail \
 --output-dir output2 \
 --setup-commands="sudo add-apt-repository -y -u -s \
 ppa:pushkarnk/test-builds" \
 --no-built-binaries \
 python-trio \
 -- lxd autopkgtest/ubuntu/noble/amd64

...
...
...
================ 680 passed, 34 skipped, 42 deselected in 5.98s ================
autopkgtest [16:16:15]: test upstream: -----------------------]
upstream PASS
autopkgtest [16:16:15]: test upstream: - - - - - - - - - - results - - - - - - - - - -
autopkgtest [16:16:16]: @@@@@@@@@@@@@@@@@@@@ summary
upstream PASS

----

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

autokgtests for dnspython - a reverse dependency - also pass:

----

$ autopkgtest \
 --apt-upgrade \
 --shell-fail \
 --output-dir output1 \
 --setup-commands="sudo add-apt-repository -y -u -s \
 ppa:pushkarnk/test-builds" \
 --no-built-binaries \
 dnspython \
 -- lxd autopkgtest/ubuntu/noble/amd64

...
...
...

================ 1359 passed, 19 skipped, 9 warnings in 57.45s =================
autopkgtest [15:44:35]: test py3: -----------------------]
py3 PASS
autopkgtest [15:44:36]: test py3: - - - - - - - - - - results - - - - - - - - - -
autopkgtest [15:44:36]: @@@@@@@@@@@@@@@@@@@@ summary
py3 PASS

-----

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :
Revision history for this message
Chris Peterson (cpete) wrote :

This seems reasonable to me. If we later find out a way to change permissions on the builder to avoid this issue then we can just request a sync. Only thing to fix is patch headers.

review: Needs Fixing
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

> This seems reasonable to me. If we later find out a way to change permissions
> on the builder to avoid this issue then we can just request a sync. Only thing
> to fix is patch headers.

Thanks, Chris! I've added the DEP3 header.

Revision history for this message
Chris Peterson (cpete) wrote :

Thanks! Looks good to me now.

review: Approve
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote (last edit ):

Thanks to the suggestion from Vladimir. I have updated the patch to handle(ignore) the PermissionError instead of commenting out the relevant code.

Revision history for this message
Nick Rosbrook (enr0n) wrote :

This looks good code-wise. Just a few organizational comments:

1. Can you please squash your fixup commits into "Add patch to avoid PermissioErrors on LP"? This keeps the history cleaner.
2. Please update both the patch Description: field, and the changelog entry to reflect that you are catching and ignoring the exception. The current language used suggests the code is still commented out, which is not true.

After that is fixed I will upload this. Thanks!

review: Needs Fixing
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

> This looks good code-wise. Just a few organizational comments:
>
> 1. Can you please squash your fixup commits into "Add patch to avoid
> PermissioErrors on LP"? This keeps the history cleaner.
> 2. Please update both the patch Description: field, and the changelog entry to
> reflect that you are catching and ignoring the exception. The current language
> used suggests the code is still commented out, which is not true.
>
> After that is fixed I will upload this. Thanks!

Thanks, the commit history was looking very bad indeed. Fixed now.

Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thanks! Uploaded now.

review: Approve

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 375142e..ae20231 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+python-trio (0.24.0-1ubuntu1) noble; urgency=medium
7+
8+ * d/patches: In test_socket.py, handle PermissionError
9+ which may be thrown if setsockopt() is invoked
10+ with SO_BINDTODEVICE (LP: #2054772)
11+
12+ -- Pushkar Kulkarni <pushkar.kulkarni@canonical.com> Tue, 27 Feb 2024 13:40:53 +0530
13+
14 python-trio (0.24.0-1) unstable; urgency=low
15
16 * New upstream version 0.24.0
17diff --git a/debian/control b/debian/control
18index 9353e42..f07b02a 100644
19--- a/debian/control
20+++ b/debian/control
21@@ -2,7 +2,8 @@ Source: python-trio
22 Section: python
23 Priority: optional
24 Standards-Version: 4.6.2
25-Maintainer: Debian Python Team <team+python@tracker.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
28 Uploaders:
29 Robie Basak <robie@justgohome.co.uk>,
30 Michael Fladischer <fladi@debian.org>,
31diff --git a/debian/patches/0002-workaround-LP-test-failure.patch b/debian/patches/0002-workaround-LP-test-failure.patch
32new file mode 100644
33index 0000000..d426a37
34--- /dev/null
35+++ b/debian/patches/0002-workaround-LP-test-failure.patch
36@@ -0,0 +1,32 @@
37+Description: Temporary patch to resolve FTBFS on Launchpad
38+ Build-time tests that call setsocketopt(...) with
39+ SO_BINDTODEVICE fail with PermissionError only on
40+ Launchpad's builder VMs. This patch, which is meant
41+ to be temporary, catches the PermissionError, effectively
42+ ignoring it.
43+Author: Pushkar Kulkarni <pushkar.kulkarni@canonical.com>
44+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-trio/+bug/2054772
45+Forwarded: not-needed
46+---
47+--- a/src/trio/_tests/test_socket.py
48++++ b/src/trio/_tests/test_socket.py
49+@@ -1,5 +1,6 @@
50+ from __future__ import annotations
51+
52++import builtins
53+ import errno
54+ import inspect
55+ import os
56+@@ -410,7 +411,11 @@
57+ # specifying optlen. Not supported on pypy, and I couldn't find
58+ # valid calls on darwin or win32.
59+ if hasattr(tsocket, "SO_BINDTODEVICE"):
60+- sock.setsockopt(tsocket.SOL_SOCKET, tsocket.SO_BINDTODEVICE, None, 0)
61++ # SO_BINDTODEVICE causes a PermissionError on Launchpad's builders (TODO: why?)
62++ try:
63++ sock.setsockopt(tsocket.SOL_SOCKET, tsocket.SO_BINDTODEVICE, None, 0)
64++ except builtins.PermissionError:
65++ print("Warning: PermissionError thrown by setsockopt() with SO_BINDTODEVICE. Ignoring.")
66+
67+ # specifying value
68+ sock.setsockopt(tsocket.IPPROTO_TCP, tsocket.TCP_NODELAY, False)
69diff --git a/debian/patches/series b/debian/patches/series
70index 13459b9..7c2eb7f 100644
71--- a/debian/patches/series
72+++ b/debian/patches/series
73@@ -1 +1,2 @@
74 0001-Use-local-objects.inv-in-intersphinx-mapping.patch
75+0002-workaround-LP-test-failure.patch

Subscribers

People subscribed via source and target branches