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

Subscribers

People subscribed via source and target branches