christofmuc / KnobKraft-orm

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian
GNU Affero General Public License v3.0
207 stars 27 forks source link

Python3 issue with current build on Apple Silicon Mac #316

Closed redconfetti closed 7 months ago

redconfetti commented 8 months ago

I tried to start up the latest build for Mac after installing Python3. The log reports:

15:10:00: warning Couldn't find a Python 3.10 installation. Please install using Homebrew (brew install python3), MacPorts (sudo port install python310) or from https://www.python.org/ftp/python/. Turning off all adaptations.

I see in GenericAdaptation.cpp it is looking for a path present for Python v3.10

I tried to install this version explicitly and the path is /opt/homebrew/opt/python\@3.10/Frameworks/Python.framework/Versions/3.10/.

$ brew reinstall python@3.10
$ ls /opt/homebrew/opt/python3/Frameworks/Python.framework/Versions/3.10
ls: /opt/homebrew/opt/python3/Frameworks/Python.framework/Versions/3.10: No such file or directory
$ ls /opt/homebrew/opt/python\@3.10/Frameworks/Python.framework/Versions/3.10/
Headers     Python      Resources   _CodeSignature  bin     include     lib     share

I uninstalled this and installed the 'python3' package, which installs under /opt/homebrew/opt/python3/Frameworks/Python.framework/Versions/3.12/

$ brew install python3
$ ls /opt/homebrew/opt/python3/Frameworks/Python.framework/Versions/3.12/
Headers     Python      Resources   _CodeSignature  bin     include     lib     share

Additionally I get a crash report each time I close the application. I can provide the full report to you if needed.

Version:                (2.2.2)
Code Type:             X86-64 (Translated)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-03-19 15:19:21.7735 -0400
OS Version:            macOS 14.1 (23B74)
Report Version:        12
Anonymous UUID:        6C8576F9-A8F7-5E9F-834D-5E8634BE90EC

Time Awake Since Boot: 25000 seconds

System Integrity Protection: enabled

Notes:
PC register does not match crashing frame (0x0 vs 0x7FF89F6B2A78)

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

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process:   KnobKraftOrm [36996]

Application Specific Information:
abort() called

Error Formulating Crash Report:
PC register does not match crashing frame (0x0 vs 0x7FF89F6B2A78)

Thread 0 Crashed:: JUCE Message Thread Dispatch queue: com.apple.main-thread
0   ???                                 0x7ff89f6b2a78 ???
1   libsystem_kernel.dylib              0x7ff80f1c47ce __pthread_kill + 10
2   libsystem_pthread.dylib             0x7ff80f1fcf30 pthread_kill + 262
3   libsystem_c.dylib                   0x7ff80f11ba49 abort + 126
4   libpython3.10.dylib                    0x10d30001d fatal_error_exit + 13
5   libpython3.10.dylib                    0x10d2ffe8f fatal_error + 31
6   libpython3.10.dylib                    0x10d3049d4 _Py_FatalErrorFunc + 52
7   libpython3.10.dylib                    0x10d28a6d8 take_gil + 536
8   libpython3.10.dylib                    0x10d3078f1 PyGILState_Ensure + 97
9   KnobKraftOrm                           0x100fa8f5c pybind11::detail::get_internals() + 60
10  KnobKraftOrm                           0x100fa8e9c pybind11::gil_scoped_acquire::gil_scoped_acquire() + 28
11  KnobKraftOrm                           0x101173a02 knobkraft::GenericAdaptation::shutdownGenericAdaptation() + 18
12  KnobKraftOrm                           0x100fb6d91 TheOrmApplication::shutdown() + 81
13  KnobKraftOrm                           0x101404fc5 juce::JUCEApplicationBase::shutdownApp() + 85
14  KnobKraftOrm                           0x101405c0e juce::JUCEApplicationBase::main() + 174
15  KnobKraftOrm                           0x101405b13 juce::JUCEApplicationBase::main(int, char const**) + 83
16  dyld                                   0x2028253a6 start + 1942
redconfetti commented 8 months ago

I installed Python 3.10rc2 and this resolved my issue for now. This is a good work around until we perhaps update the code to detect the latest version. Now I can try to add an adaptation for the Alesis QSR module that I own.

christofmuc commented 7 months ago

Thank you! I fixed the crash on exit when no Python present for the next release.

The Mac python detection is a long and sad story, my original plan was to include Python in the DMG built, but the whole package signing process I got never to work. I have a branch that does a smarter search for the install location, which is what I will try next.

christofmuc commented 7 months ago

2.3.0 now needs Python 3.12, which should be much easier to use via homebrew