Bug 1990768 - python-pyside2 fails to build with Python 3.10: TypeError: can only concatenate str (not "NoneType") to str
Summary: python-pyside2 fails to build with Python 3.10: TypeError: can only concatena...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyside2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10 F35FTBFS F36FTBFS 2048781
TreeView+ depends on / blocked
 
Reported: 2021-08-06 07:58 UTC by Tomáš Hrnčiar
Modified: 2022-02-01 20:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-01 20:14:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-08-06 07:58:41 UTC
python-pyside2 fails to build with Python 3.10.0rc1.

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 326, in <module>
    generate_all_pyi(outpath, options=options)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 305, in generate_all_pyi
    generate_pyi(import_name, outpath, options)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 241, in generate_pyi
    HintingEnumerator(fmt).module(import_name)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py", line 95, in module
    ret.update(self.klass(class_name, klass))
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py", line 129, in klass
    signature = getattr(thing, "__signature__", None)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/loader.py", line 97, in pyside_type_init
    return parser.pyside_type_init(type_key, sig_strings)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 447, in pyside_type_init
    props = calculate_props(line)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 344, in calculate_props
    annotations["return"] = (_resolve_type(returntype, line, 0, handle_retvar)
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 277, in _resolve_type
    pieces.append(to_string(part))
  File "/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/redhat-linux-build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 228, in to_string
    return thing.__module__ + "." + name if dot else name
TypeError: can only concatenate str (not "NoneType") to str

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/02360967-python-pyside2/

For all our attempts to build python-pyside2 with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-pyside2/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 is already included in Fedora 35. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2021-08-10 13:35:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 2 Fedora Release Engineering 2021-08-22 04:27:58 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 35.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-10-01).

A week before the mass branching of Fedora 36 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 34 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-36/f-36-key-tasks.html

Comment 3 Richard Shaw 2021-08-22 12:18:30 UTC
Python 3.10 compatibility was just fixed upstream but has not made it into a release.

https://bugreports.qt.io/browse/PYSIDE-1436

Comment 4 Richard Shaw 2021-08-24 11:37:51 UTC
It looks like upstream is only going to apply the fix in Pyside2 6.x and not backport to 5.x...

Comment 5 Richard Shaw 2022-01-31 21:28:13 UTC
Hopefully this will get fixed with a new release soon.

https://wiki.qt.io/Qt_for_Python_Development_Notes#13._January_2022

Comment 6 Richard Shaw 2022-01-31 21:40:32 UTC
Bah, 5.15.2.1 is out but it doesn't address all the Python 3.10 issues.

Comment 7 Kevin Kofler 2022-02-01 03:41:33 UTC
Well, it has a bunch of Python 3.10 fixes:
https://code.qt.io/cgit/pyside/pyside-setup.git/log/?h=v5.15.2.1

What error are you getting with 5.15.2.1? (I do not see any 5.15.2.1 build attempt in Koji.)

Comment 8 Richard Shaw 2022-02-01 04:08:35 UTC
I was just trying local mock builds first. I just kicked off a scratch build but not staying up waiting on it, we'll see what happens.

https://koji.fedoraproject.org/koji/taskinfo?taskID=82218346

Comment 9 Kevin Kofler 2022-02-01 04:31:29 UTC
/builddir/build/BUILD/pyside-setup-opensource-src-5.15.2/sources/shiboken2/libshiboken/pep384impl.cpp:755:12: error: use of undeclared identifier '_Py_Mangle'
    return _Py_Mangle(privateobj, name);
           ^

So they screwed up the backport there: compare:
https://code.qt.io/cgit/pyside/pyside-setup.git/commit/sources/shiboken6/libshiboken/pep384impl.cpp?id=81e9cff884d6b03cdf64a5dd6ec6564d99177e0c
with:
https://code.qt.io/cgit/pyside/pyside-setup.git/commit/sources/shiboken2/libshiboken/pep384impl.cpp?h=v5.15.2.1&id=298cfb2d4a9674ed00b3769fa396a292c075c51c

This part:
-#ifndef Py_LIMITED_API
-    return _Py_Mangle(privateobj, name);
-#else
…
-#endif // else Py_LIMITED_API
is missing and needed to fix the build.

Comment 10 Richard Shaw 2022-02-01 13:35:38 UTC
That seems to have worked. Now I just need to update the other patch which deals with setup.py not accepting --reuse-build anymore.

Comment 11 Richard Shaw 2022-02-01 13:50:48 UTC
The %py3_check_import fails but the package builds so going ahead with a build for now so things are less broken.

Thanks for the assist!

Comment 12 Richard Shaw 2022-02-01 15:44:18 UTC
Now failing ONLY for armv7hl during clang detection during CMake configuration:

    ld.lld: error: unknown argument '-dT'

Comment 13 Richard Shaw 2022-02-01 20:14:32 UTC
Ok, thank goodness for the new toolchain macro. Switching it it over the manual hacks to %optflags fixed the arm build.

Now to see if all this still works for Python 3.11, but that's another BZ.


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