Do I need to create different binaries for different versions of macOS

25 views
Skip to first unread message

Harshit Dwivedi

unread,
Apr 10, 2020, 11:54:58 AM4/10/20
to PyInstaller
Hey all!
I using PyInstaller to create a mac binary (.app file) and while it works well on macOS Catalina and Mojave, the app crashes on launch on High Sierra and below.
I'm using Catalina to build the app and here's the crash log: 

ImportError: dlopen(/Applications/AfterShoot.app/Contents/MacOS/rawpy/_rawpy.cpython-37m-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /Applications/AfterShoot.app/Contents/MacOS/rawpy/../liblcms.1.0.19.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Applications/AfterShoot.app/Contents/MacOS/rawpy/../liblcms.1.0.19.dylib
  File "aftershoot.py", line 14, in <module>
  File "loader/pyimod03_importers.py", line 623, in exec_module
  File "gui/inference_utils/inference_worker_thread.py", line 23, in <module>
  File "loader/pyimod03_importers.py", line 623, in exec_module
  File "src/raw_to_jpeg/raw_to_jpeg.py", line 4, in <module>
  File "loader/pyimod03_importers.py", line 623, in exec_module
  File "rawpy/__init__.py", line 5, in <module>

I was wondering if this is normal and if it's compulsory for me to build multiple variants (each containing a different version of liblcms) for different macOS versions?

Here's my spec file just in case: 

  
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None
import os
import site

site_packages_dir = site.getsitepackages()[0]

venv = ['/Users/harshitdwivedi/Desktop/new_tf_env/lib/python3.7/site-packages', '/Users/aayusharora/virtuals/env/lib/python3.7/site-packages/']

a = Analysis(['../aftershoot.py'],
             pathex=venv,
             binaries=None,
             datas=[('../src/data', './src/data'), ('../gui/assets', 'gui/assets')],
             hiddenimports=['astor'],
             hookspath=[],
             runtime_hooks=[],
             excludes=['matplotlib', 'imageio', 'tensorboard', 'tensorflow-estimator', 'keras-preprocessing'],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)

# remove extra binaries
a.binaries = a.binaries - TOC([
  ('QtQuick', None, None),
  ('QtVirtualKeyboard', None, None),
  ('libtcl8.6.dylib', None, None),
  ('libtk8.6.dylib', None, None),
  ('_codecs_jp.cpython-37m-darwin.so', None, None),
])

# remove extra binary folders
a.binaries = [x for x in a.binaries if not
 os.path.dirname(x[1]).startswith("{}/skimage/draw".format(site_packages_dir))]
a.binaries = [x for x in a.binaries if not
 os.path.dirname(x[1]).startswith("{}/skimage/feature".format(site_packages_dir))]
a.binaries = [x for x in a.binaries if not
 os.path.dirname(x[1]).startswith("{}/skimage/filters".format(site_packages_dir))]

# remove the skimage path from resources
a.datas = [x for x in a.datas if not
 os.path.dirname(x[1]).startswith("{}/skimage".format(site_packages_dir))]

pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)


exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name='aftershoot',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=False,
          console=False )


coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               debug=False,
               strip=False,
               upx=False,
               upx_exclude=[],
               name='AfterShoot',
               icon='gui/assets/icon.icns',
               console=False)

app = BUNDLE(coll,
             name='AfterShoot.app',
             icon='../gui/assets/icon.icns',
             bundle_identifier=None,
             info_plist={
            'NSHighResolutionCapable': True,
            'NSRequiresAquaSystemAppearance': False,
            'CFBundleName': 'AfterShoot',
            'CFBundleIdentifier':'co.aftershoot.aftershoot'
            },)

import subprocess
subprocess.call("python buildscripts/add_binaries.py", shell=True)

Thanks!
Reply all
Reply to author
Forward
0 new messages