Bug 2019069 - pybluez: FTBFS in Fedora Rawhide, 2to3 removed in setuptools 58+
Summary: pybluez: FTBFS in Fedora Rawhide, 2to3 removed in setuptools 58+
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pybluez
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F36FTBFS PYTHON3.11 2016051
TreeView+ depends on / blocked
 
Reported: 2021-11-01 15:08 UTC by Tomáš Hrnčiar
Modified: 2021-11-02 15:33 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-02 15:09:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-01 15:08:26 UTC
Since Setuptools 58+ upstream removed support for 2to3 during
builds. This is breaking change and thus package is FTBFS.
For more info see this change: https://fedoraproject.org/wiki/Changes/Setuptools_58%2B

Comment 1 Gwyn Ciesla 2021-11-02 14:29:39 UTC
This package doesn't use 2to3 to build, and builds in rawhide for me.

Comment 2 Miro Hrončok 2021-11-02 14:42:27 UTC
It seems to me it uses it: https://github.com/pybluez/pybluez/blob/0.23/setup.py#L127

And a build fails:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.zeRqdV
+ umask 022
+ cd /builddir/build/BUILD
+ cd pybluez-0.23
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
error in PyBluez setup command: use_2to3 is invalid.
error: Bad exit status from /var/tmp/rpm-tmp.zeRqdV (%build)
    Bad exit status from /var/tmp/rpm-tmp.zeRqdV (%build)



A scratch build https://koji.fedoraproject.org/koji/taskinfo?taskID=78220516

Comment 3 Gwyn Ciesla 2021-11-02 15:09:06 UTC
Ah, I see. Fixed.

Comment 4 Miro Hrončok 2021-11-02 15:33:01 UTC
I wonder why was this option used in the first place. The difference without it in code is only minor:

--- python3-bluez-0.23-4.fc35.x86_64/usr/lib64/python3.10/site-packages/bluetooth/bluez.py	2021-07-23 07:07:42.000000000 +0200
+++ python3-bluez-0.23-5.fc36.x86_64/usr/lib64/python3.10/site-packages/bluetooth/bluez.py	2019-12-28 01:53:51.000000000 +0100
@@ -151,9 +151,9 @@
 
 def _get_available_ports(protocol):
     if protocol == RFCOMM:
-        return list(range(1, 31))
+        return range (1, 31)
     elif protocol == L2CAP:
-        return list(range(0x1001, 0x8000, 2))
+        return range (0x1001, 0x8000, 2)
     else:
         return [0]
 
(and _get_available_ports is only sued ina for loop, so the explicit cast to list() odes not add any value)

Comment 5 Miro Hrončok 2021-11-02 15:33:39 UTC
Already done in upstream, so we should be safe: https://github.com/pybluez/pybluez/commit/37d78880179b2a83e7052e0c2b9393499dd3b857


Note You need to log in before you can comment on or make changes to this bug.