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

PYTHON_LIMITED_LIBRARIES not found/CMake build (unsupported)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0, 6.6.3
    • 6.6.2
    • Build System
    • None
    • Windows
    • 8314b1855 (dev), 91c11342a (6.6)

    Description

       

      since 6.6.2 the build fails because of limited api libs:

      -- Python_Development_FOUND: TRUE 
      -- Python_LIBRARIES: D:/bld/pyside6_1708526226172/_h_env/libs/python311.lib
      -- Python_INCLUDE_DIRS: D:/bld/pyside6_1708526226172/_h_env/include
      -- Python_Interpreter_FOUND: TRUE
      -- Python_EXECUTABLE: %PREFIX%\python.exe
      -- Python_VERSION: 3.11.8
      -- PYTHON_EXTENSION_SUFFIX: .cp311-win_amd64
      -- PYTHON_LIMITED_LIBRARIES: 
      CMake Error at cmake/ShibokenHelpers.cmake:8 (message): -- Configuring incomplete, errors occurred!
      The Limited API was enabled, but was not found! 
      -- Cache values

       

      seems PYTHON_LIMITED_LIBRARIES is not found, maybe because it looks for backslashes as cmake paths can contain forward slashes (see Python_LIBRARIES above):

       

      macro(shiboken_check_if_limited_api)
          # TODO: Figure out how to use limited API libs when cross-building to Windows, if that's ever
          # needed. Perhaps use host python to walk the libs of the target python installation.
          if(NOT SHIBOKEN_IS_CROSS_BUILD AND WIN32)
              # On Windows, PYTHON_LIBRARIES can be a list. Example:
              #    optimized;C:/Python36/libs/python36.lib;debug;C:/Python36/libs/python36_d.lib
              # On other platforms, this result is not used at all.
              execute_process(
                  COMMAND ${Python_EXECUTABLE} -c "if True:
                      from pathlib import Path
                      libs = r'${Python_LIBRARIES}'
                      libs = libs.split(';')
                      for lib in libs:
                          if '\\\\' in lib and Path(lib).is_file():
                              lib = Path(lib)
                              prefix = lib.parent
                              py = lib.name
                              if py.startswith('python3'):
                                  print(prefix / 'python3.lib')
                                  break
                      "
                  OUTPUT_VARIABLE PYTHON_LIMITED_LIBRARIES
                  OUTPUT_STRIP_TRAILING_WHITESPACE)
          endif()
          message(STATUS "PYTHON_LIMITED_LIBRARIES: " ${PYTHON_LIMITED_LIBRARIES})
          if(FORCE_LIMITED_API OR SHIBOKEN_PYTHON_LIMITED_API)
              set(PYTHON_LIMITED_API 1)
              if(WIN32)
                  set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_LIMITED_LIBRARIES})
              endif()
          endif()
      endmacro()
      

       

      an option could be using the new Python::SABIModule target (if cmake is >= 3.26)

      or at least allow to override it

       

       

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-2612
          # Subject Branch Project Status CR V

          Activity

            People

              shpremna Shyamnath Premnadh
              jschueller Julien Schueller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes