Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1864

Fails to build with Python 3.11a6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.15.3
    • Shiboken
    • None
    • Any Linux system with Python 3.11a6 -- e.g. OpenMandriva Cooker

    Description

      Trying to build pyside with Python 3.11a6 fails for various reasons (assigning to Py_TYPE instead of using Py_SET_TYPE, use of removed _Py_Mangle API, assigning to Py_REFCNT instead of using Py_SET_REFCNT).

      I'm attaching a (partial) patch to fix these.

      Unfortunately with the patch applied, pyside2 still fails with a much harder to debug error.

      FAILED: sources/pyside2/PySide2/QtCore/CMakeFiles/QtCore_pyi /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/pyside2/PySide2/QtCore/CMakeFiles/QtCore_pyi 
      cd /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/pyside2/PySide2/QtCore && /usr/bin/cmake -E env LD_LIBRARY_PATH=/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/pyside2/libpyside:/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/libshiboken /usr/bin/python3 /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py QtCore --sys-path /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/pyside2 /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule
      <frozen importlib._bootstrap>:241: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 896 from C header, got 904 from PyObject
      /home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py:199: RuntimeWarning: pyside_type_init:
      
              UNRECOGNIZED:   'zero(Any)'
              OFFENDING LINE: 'PySide2.QtCore.QSettings.value(self,arg__1:QString,defaultValue:QVariant=0,type:PyObject=0)->PyObject'
              
        warnings.warn("""pyside_type_init:
      Traceback (most recent call last):
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 327, in <module>
          generate_all_pyi(outpath, options=options)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 306, in generate_all_pyi
          generate_pyi(import_name, outpath, options)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 242, in generate_pyi
          HintingEnumerator(fmt).module(import_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.11/contextlib.py", line 155, in __exit__
          self.gen.throw(typ, value, traceback)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/sources/pyside2/PySide2/QtCore/../support/generate_pyi.py", line 156, in module
          yield
          ^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py", line 105, in module
          ret.update(self.klass(class_name, klass))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py", line 139, in klass
          signature = getattr(thing, "__signature__", None)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/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 "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 447, in pyside_type_init
          props = calculate_props(line)
                  ^^^^^^^^^^^^^^^^^^^^^
        File "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/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 "/home/bero/temp/abf/pyside2/BUILD/pyside-setup-opensource-src-5.15.3/build/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py", line 280, in _resolve_type
          return eval(result, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 1, in <module>
        File "/usr/lib64/python3.11/typing.py", line 1339, in __getitem__
          return self.__getitem_inner__(params)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.11/typing.py", line 322, in inner
          return func(*args, **kwds)
                 ^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.11/typing.py", line 1345, in __getitem_inner__
          result = _type_check(result, msg)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib64/python3.11/typing.py", line 183, in _type_check
          raise TypeError(f"Plain {arg} is not valid as type argument")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      TypeError: Plain typing.Optional is not valid as type argument
      free(): invalid size
      Subprocess aborted
      ninja: build stopped: subcommand failed.
      

      Attachments

        Activity

          People

            kleint Friedemann Kleint
            bero Bernhard Rosenkränzer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: