mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.4k stars 434 forks source link

Mu 1.2.0 fails to open in macOS 10.12 Sierra #2368

Closed carlosperate closed 1 year ago

carlosperate commented 1 year ago

Double clicking on the .app bundle doesn't do anything, no visible crash and no crash reporter.

Using the open command in the terminal prints this error:

$ open Mu\ Editor.app/
LSOpenURLsWithRole() failed with error -10810 for the file /Users/carlos/Documents/Mu Editor.app.

And executing the launcher directly:

$ ./Mu\ Editor.app/Contents/MacOS/Mu\ Editor 
Traceback (most recent call last):
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/mu/__main__.py", line 1, in <module>
    from mu.app import run
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/mu/app.py", line 48, in <module>
    from .modes import (
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/mu/modes/__init__.py", line 1, in <module>
    from .python3 import PythonMode
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/mu/modes/python3.py", line 27, in <module>
    from qtconsole.manager import QtKernelManager
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/qtconsole/manager.py", line 9, in <module>
    from jupyter_client import KernelManager
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/jupyter_client/__init__.py", line 4, in <module>
    from .connect import *
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/jupyter_client/connect.py", line 21, in <module>
    import zmq
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/__init__.py", line 103, in <module>
    from zmq import backend
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/__init__.py", line 31, in <module>
    raise original_error from None
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/__init__.py", line 26, in <module>
    _ns = select_backend(first)
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/select.py", line 31, in select_backend
    mod = import_module(name)
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/cython/__init__.py", line 6, in <module>
    from . import (
ImportError: dlopen(/Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/cython/_device.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/carlos/Documents/Mu Editor.app/Contents/Resources/Python/lib/python3.8/site-packages/zmq/backend/cython/../../.dylibs/libsodium.23.dylib

In comparison 1.1.1 had an issue with the user venv dependencies not being compatible, but the application launched and the crash reporter captured it.

carlosperate commented 1 year ago

Okay, so I've traced this down to the pyzmq wheel. As the Mu build is run in CI runner with macOS 10.15 x86 the wheel pip fetches when invoked from pup is for the macosx_10_15_universal2 platform:

2022-11-14T12:08:07.3947990Z 20221114 120807 I pup.plugins.pip_install pip out: Collecting pyzmq>=17.1
2022-11-14T12:08:07.4066640Z 20221114 120807 I pup.plugins.pip_install pip out:   Using cached pyzmq-24.0.1-cp38-cp38-macosx_10_15_universal2.whl (1.8 MB)

Looking at the current pup output (like this one) pyzmq is the only non-compatible wheel, but this is only by chance, as there is no reason any of the other dependencies might not have the same issue in the future.

We might need to add a --platform flag to the pip download command from pup for building macOS 10.12+ installers, to avoid fetching newer wheels.

carlosperate commented 1 year ago

Created this pup issue as a feature request:

And draft PR here to test it:

I can confirm the generated macOS installer works in 10.12. To download it go this link and click on the highlighted installer (you need to be logged in GitHub for the link to work): https://github.com/mu-editor/mu/actions/runs/3688654382

image
carlosperate commented 1 year ago

Okay, I've merged PR https://github.com/mu-editor/mu/pull/2371 which will have fixed this issue for the next Mu release, thanks everyone for the report and the testing!