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

5.15: Standalone wheels embed non-standard macOS framework bundles

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.7
    • 5.13.2, 5.15.2
    • Build System, PySide
    • None
    • All macOS versions since 10.13.
      All PySide2 versions since at least 5.13.x.
    • macOS

    Description

      Standalone wheels on macOS include all the Framework bundles for Qt under PySide2/Qt/lib/. Unfortunately, those bundles do not adhere to the Apple specifications for Framework bundles, reported e.g. here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html#//apple_ref/doc/uid/20002253-BAJEJJAB

      Excerpt from the link reported above:
      Listing 1 A simple framework bundle

      MyFramework.framework/
          MyFramework  -> Versions/Current/MyFramework
          Resources    -> Versions/Current/Resources
          Versions/
              A/
                  MyFramework
                  Resources/
                      English.lproj/
                          InfoPlist.strings
                      Info.plist
              Current  -> A
      

      Links are a relevant part of the specification, as further described in the same page:

      In this listing, the Versions directory is the only real directory at the top level of the bundle. Both MyFramework and Resources are symbolic links to items in Versions/A. [...] Listing 1 shows that the top-level symbolic links don’t point directly to items inside the Versions/A directory. Instead, they point to items in the Versions/Current directory, which itself is a symbolic link to Versions/A. [...] Programs built using the earlier major version of the library must continue to use it, but programs in development should link against the current version of the library.

      Conversely, let's look at the structure of the embedded QtCore.framework in the standalone wheels:

      QtCore.framework/
          Resources/
             Info.plist
          Versions/
              5/
                 QtCore
      

      It is clear that all the needed symlinks are missing (QtCore, Current, ...). This makes finding and using the frameworks embedded in the standalone wheels quite hard, e.g. from macholib or other scanners. Ultimately, it makes impossible to bundle apps with py2app using the official standalone wheels for PySide2.

      At the moment, as a workaround I am manually creating the missing symlinks in the installed copy of the PySide2 standalone wheels but, I believe those shipped frameworks should adhere to the bundle specifications natively.

      Downloading the wheels from PyPI shows clearly that the symlinks are missing in all the versions shipped so far. I also confirmed with a local build with the --standalone flag that those symlinks are not generated or not included in the dist wheel packages (macOS 10.15.7, Qt/PySide2 5.15.2).

      Attachments

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

        Activity

          People

            falt Simo Fält
            alby128 Alberto Sottile
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change