ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
350 stars 35 forks source link

Application py2app-ed in Sierra crashes on Yosemite #230

Open ronaldoussoren opened 7 years ago

ronaldoussoren commented 7 years ago

Original report by Fabio (Bitbucket: fmarzocca, GitHub: fmarzocca).


I have successfully packaged a python3-tkinter application on Mac Os Sierra (10.12.5, py2app v.0.12), and it is working nice. When I installed the application on a Mac Os Yosemite (10.10.3) it crashed with the following error. Is it normal? (CLT are installed in both computers)

#!system

    Process:               Movie Quantizer [568]
    Path:                  /Applications/Movie Quantizer.app/Contents/MacOS/Movie Quantizer
    Identifier:            org.pythonmac.unspecified.MovieQuantizer
    Version:               0.1.0 (0.0.0)
    Code Type:             X86-64 (Native)
    Parent Process:        ??? [1]
    Responsible:           Movie Quantizer [568]
    User ID:               501

    Date/Time:             2017-07-05 12:48:33.456 +0200
    OS Version:            Mac OS X 10.10.3 (14D136)
    Report Version:        11
    Anonymous UUID:        30F78AFD-11DC-586C-7FA3-6614FE3FF344

    Time Awake Since Boot: 340 seconds

    Crashed Thread:        0  Dispatch queue: com.apple.main-thread

    Exception Type:        EXC_BREAKPOINT (SIGTRAP)
    Exception Codes:       0x0000000000000002, 0x0000000000000000

    Dyld Error Message:
      Symbol not found: _getentropy
      Referenced from: /Applications/Movie Quantizer.app/Contents/Frameworks/Python.framework/Versions/3.6/Python (which was built for Mac OS X 10.12)
      Expected in: /usr/lib/libSystem.B.dylib

If I launch the application directly from the terminal (in Yosemite), I got a similar error:

#!system

dyld: lazy symbol binding failed: Symbol not found: _getentropy

  Referenced from: /Applications/Movie Quantizer.app/Contents/Frameworks/Python.framework/Versions/3.6/Python (which was built for Mac OS X 10.12)

  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _getentropy

  Referenced from: /Applications/Movie Quantizer.app/Contents/Frameworks/Python.framework/Versions/3.6/Python (which was built for Mac OS X 10.12)

  Expected in: /usr/lib/libSystem.B.dylib
ronaldoussoren commented 7 years ago

Original comment by Ronald Oussoren (Bitbucket: ronaldoussoren, GitHub: ronaldoussoren).


You should build CPython and extensions on the lowest macOS release you want to target.

It should be possible to build on the latest OS release as well, but that requires some care and appears to be broken at the moment due to CPython's configure script detecting features that aren't available on older macOS releases.

I'm definitely interested in being able to target older macOS releases using a CPython build on the latest macOS release, but don't have time to work on that right now (writing with my CPython contributor hat on). A quick hack would be to run configure, then remove unwanted symbols from the generated pyconfig.h file before actually building (and don't forget to set the deployment target when running the configuratie script).

There's not much I can do about this in py2app.