CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
777 stars 120 forks source link

CadQuery2 / CQ-Editor not launching on macOS BigSur #209

Open jwhevans opened 3 years ago

jwhevans commented 3 years ago

I've been running the master branches of both repositories on macOS Catalina. I installed on a BigSur machine and cq-editor never launches. I get an empty python icon in the dock. Is anyone else seeing this? Is it a known issue? The stable releases run on both Catalina and BigSur

adam-urbanczyk commented 3 years ago

I don't have access to mac and never was able to set up CI for CQ-editor to test on macOS with an OpenGL context so YMMV. Maybe @jmwright has some ideas?

jmwright commented 3 years ago

OpenGL is being deprecated in favor of Metal in MacOS, but it sounds like it should still be available. It might be a Python version issue.

https://github.com/napari/napari/issues/1393#issuecomment-712268324

@jwhevans Are you running CQ-editor from the command line? Please post any warming or error messages from running it that way.

Also, please post the results of conda info and conda list with your CadQuery environment activated.

Another thing you might try is to force Python 3.7 with master. The following should work to do that.

conda install -c cadquery -c conda-forge cadquery=master python=3.7
kargeor commented 3 years ago

Try rm ~/Library/Preferences/com.cadquery.CQ\ GUI.plist

jwhevans commented 3 years ago

Sorry for the delay. I had a project to finish. I ran through the previous points. I was not able to load the program regardless of environment or python version changes. However @kargeor 's suggestion worked. Now it runs as expected.

adam-urbanczyk commented 3 years ago

Good to hear, do you understand why it worked / what was the actual root cause?

haberman commented 3 years ago

I am having the same problem described in this bug: on Big Sur, cq-editor won't launch. I get an empty Python icon in the dock, but the app never launches.

I also notice Python is spinning at 100% CPU (infinite loop of some sort?). With Instruments I was able to see where the spinning was happening, but it wasn't obvious to me what is going on here:

Screen Shot 2020-12-25 at 4 40 32 PM

In the terminal I just see this:

Warning: QApplication was created before pyqtgraph was imported; there may be problems (to avoid bugs, call QApplication.setGraphicsSystem("raster") before the QApplication is created).
Namespace(filename=None)

I tried the command suggested above (rm ~/Library/Preferences/com.cadquery.CQ\ GUI.plist) but that file did not exist on my machine.

The output of conda list is as follows:

# packages in environment at /Users/haberman/opt/anaconda3/envs/cadquery:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.12                     py_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
applaunchservices         0.2.1                      py_0    conda-forge
appnope                   0.1.2            py38h50d1736_0    conda-forge
argh                      0.26.2          pyh9f0ad1d_1002    conda-forge
astroid                   2.4.2            py38h32f6830_1    conda-forge
async_generator           1.10                       py_0    conda-forge
atomicwrites              1.4.0              pyh9f0ad1d_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
autopep8                  1.5.4              pyh9f0ad1d_0    conda-forge
babel                     2.9.0              pyhd3deb0d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
black                     20.8b1                     py_1    conda-forge
bleach                    3.2.1              pyh9f0ad1d_0    conda-forge
brotlipy                  0.7.0           py38h94c058a_1001    conda-forge
bzip2                     1.0.8                hc929b4f_4    conda-forge
c-ares                    1.17.1               hc929b4f_0    conda-forge
ca-certificates           2020.12.5            h033912b_0    conda-forge
cadquery                  master                    py3.8    cadquery
certifi                   2020.12.5        py38h50d1736_0    conda-forge
cffi                      1.14.4           py38h979bc6b_1    conda-forge
chardet                   4.0.0            py38h50d1736_0    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cloudpickle               1.6.0                      py_0    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
cq-editor                 master                    py3.8    cadquery
cryptography              3.3.1            py38h6b4ec92_0    conda-forge
curl                      7.71.1               hcb81553_8    conda-forge
dataclasses               0.7                pyhb2cacf7_7    conda-forge
dbus                      1.13.6               h0c50699_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
diff-match-patch          20200713           pyh9f0ad1d_0    conda-forge
docutils                  0.16             py38h50d1736_2    conda-forge
double-conversion         3.1.5                h4a8c4bd_2    conda-forge
eigen                     3.3.9                h926bf3e_1    conda-forge
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
expat                     2.2.9                hb1e8313_2    conda-forge
ezdxf                     0.14.2                     py_0    conda-forge
ffmpeg                    4.3.1                he496704_1    conda-forge
flake8                    3.8.4                      py_0    conda-forge
fontconfig                2.13.1            h07ff6b0_1003    conda-forge
freetype                  2.10.4               h3f75d11_0    conda-forge
future                    0.18.2           py38h50d1736_2    conda-forge
gettext                   0.19.8.1          h7937167_1005    conda-forge
gl2ps                     1.4.2                h4cff582_0    conda-forge
glew                      2.1.0                h046ec9c_2    conda-forge
glib                      2.66.4               h22858aa_1    conda-forge
gmp                       6.2.1                h2e338ed_0    conda-forge
gnutls                    3.6.13               h756fd2b_1    conda-forge
hdf4                      4.2.13            h71d84a9_1004    conda-forge
hdf5                      1.10.6          nompi_h0f9794f_1112    conda-forge
helpdev                   0.7.1              pyhd8ed1ab_0    conda-forge
icu                       68.1                 h74dc148_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
imagesize                 1.2.0                      py_0    conda-forge
importlib-metadata        3.3.0            py38h50d1736_2    conda-forge
importlib_metadata        3.3.0                hd8ed1ab_2    conda-forge
intervaltree              3.0.2                      py_0    conda-forge
ipykernel                 5.4.2            py38h9bb44b7_0    conda-forge
ipython                   7.19.0           py38h9bb44b7_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
isort                     5.6.4                      py_0    conda-forge
jedi                      0.17.2           py38h50d1736_1    conda-forge
jinja2                    2.11.2             pyh9f0ad1d_0    conda-forge
jpeg                      9d                   hbcb3906_0    conda-forge
jsoncpp                   1.8.4             ha1b3eb9_1002    conda-forge
jsonschema                3.2.0                      py_2    conda-forge
jupyter_client            6.1.7                      py_0    conda-forge
jupyter_core              4.7.0            py38h50d1736_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
keyring                   21.7.0           py38h50d1736_0    conda-forge
krb5                      1.17.2               h60d9502_0    conda-forge
lame                      3.100             h1de35cc_1001    conda-forge
lazy-object-proxy         1.4.3            py38h4d0b108_2    conda-forge
libblas                   3.9.0                3_openblas    conda-forge
libcblas                  3.9.0                3_openblas    conda-forge
libclang                  11.0.0          default_h9e6edd0_2    conda-forge
libcurl                   7.71.1               h9bf37e3_8    conda-forge
libcxx                    11.0.0               h4c3b8ed_1    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libffi                    3.3                  h046ec9c_2    conda-forge
libgfortran               5.0.0               h6c81a4c_15    conda-forge
libgfortran5              9.3.0               h6c81a4c_15    conda-forge
libglib                   2.66.4               h7424822_1    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
liblapack                 3.9.0                3_openblas    conda-forge
libllvm11                 11.0.0               hf85e3d2_0    conda-forge
libnetcdf                 4.7.4           nompi_h9d8a93f_107    conda-forge
libnghttp2                1.41.0               h7580e61_2    conda-forge
libogg                    1.3.4                hc929b4f_0    conda-forge
libopenblas               0.3.12          openmp_h54245bb_1    conda-forge
libpng                    1.6.37               h7cec526_2    conda-forge
libpq                     12.3                 h7049927_3    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libspatialindex           1.9.3                h4a8c4bd_3    conda-forge
libssh2                   1.9.0                h8a08a2b_5    conda-forge
libtheora                 1.1.1             haf1e3a3_1004    conda-forge
libtiff                   4.2.0                h355d032_0    conda-forge
libvorbis                 1.3.7                h4a8c4bd_0    conda-forge
libwebp-base              1.1.0                hbcb3906_3    conda-forge
libxml2                   2.9.10               h802ca4f_3    conda-forge
llvm-openmp               11.0.0               h73239a0_1    conda-forge
logbook                   1.5.3            py38h4d0b108_3    conda-forge
loguru                    0.5.3            py38h32f6830_2    conda-forge
lz4-c                     1.9.2                hb1e8313_3    conda-forge
markupsafe                1.1.1            py38h94c058a_2    conda-forge
mccabe                    0.6.1                      py_1    conda-forge
mistune                   0.8.4           py38h7e3306e_1002    conda-forge
mypy_extensions           0.4.3            py38h50d1736_2    conda-forge
mysql-common              8.0.22               h694c41f_1    conda-forge
mysql-libs                8.0.22               hcb0700d_1    conda-forge
nbclient                  0.5.1                      py_0    conda-forge
nbconvert                 6.0.7            py38h50d1736_3    conda-forge
nbformat                  5.0.8                      py_0    conda-forge
ncurses                   6.2                  h2e338ed_4    conda-forge
nest-asyncio              1.4.3              pyhd8ed1ab_0    conda-forge
nettle                    3.6                  hedd7734_0    conda-forge
nptyping                  1.4.0              pyhd3deb0d_0    conda-forge
nspr                      4.29                 hb1e8313_1    conda-forge
nss                       3.47                 hc0980d9_0    conda-forge
numpy                     1.19.4           py38h6ced74f_2    conda-forge
numpydoc                  1.1.0                      py_1    conda-forge
occt                      7.4.0                hb9b6dc7_5    cadquery
ocp                       7.4                     1_py3.8    cadquery
openh264                  2.1.1                hd174df1_0    conda-forge
openssl                   1.1.1i               h35c211d_0    conda-forge
packaging                 20.8               pyhd3deb0d_0    conda-forge
pandoc                    2.11.3.1             h35c211d_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.7.0              pyh9f0ad1d_0    conda-forge
path                      15.0.1           py38h50d1736_0    conda-forge
path.py                   12.5.0                        0    conda-forge
pathspec                  0.8.1              pyhd3deb0d_0    conda-forge
pcre                      8.44                 hb1e8313_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pip                       20.3.3             pyhd8ed1ab_0    conda-forge
pluggy                    0.13.1           py38h5347e94_3    conda-forge
proj                      7.1.1                h45baca5_3    conda-forge
prompt-toolkit            3.0.8              pyha770c72_0    conda-forge
psutil                    5.8.0            py38h5406a74_0    conda-forge
ptyprocess                0.6.0                   py_1001    conda-forge
pugixml                   1.10                 hb1e8313_1    conda-forge
pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pydocstyle                5.1.1                      py_0    conda-forge
pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
pygments                  2.7.3              pyhd8ed1ab_0    conda-forge
pylint                    2.6.0            py38h32f6830_1    conda-forge
pyls-black                0.4.6              pyh9f0ad1d_0    conda-forge
pyls-spyder               0.3.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt                      5.12.3           py38h50d1736_6    conda-forge
pyqt-impl                 5.12.3           py38h721a93c_6    conda-forge
pyqt5-sip                 4.19.18          py38h5745d40_6    conda-forge
pyqtchart                 5.12             py38h721a93c_6    conda-forge
pyqtgraph                 0.11.1             pyhd3deb0d_0    conda-forge
pyqtwebengine             5.12.1           py38h721a93c_6    conda-forge
pyrsistent                0.17.3           py38h7e3306e_1    conda-forge
pysocks                   1.7.1            py38h5347e94_2    conda-forge
python                    3.8.6           h624753d_2_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python-jsonrpc-server     0.4.0              pyh9f0ad1d_0    conda-forge
python-language-server    0.36.2             pyhd8ed1ab_0    conda-forge
python.app                1.3              py38h5406a74_3    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pytz                      2020.5             pyhd8ed1ab_0    conda-forge
pyyaml                    5.3.1            py38h94c058a_1    conda-forge
pyzmq                     20.0.0           py38h9b3f83f_1    conda-forge
qdarkstyle                2.8.1              pyhd8ed1ab_2    conda-forge
qt                        5.12.9               h126340a_2    conda-forge
qtawesome                 1.0.2              pyhd8ed1ab_0    conda-forge
qtconsole                 5.0.1              pyhd8ed1ab_0    conda-forge
qtpy                      1.9.0                      py_0    conda-forge
readline                  8.0                  h0678c8f_2    conda-forge
regex                     2020.11.13       py38h5406a74_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
rope                      0.18.0             pyh9f0ad1d_0    conda-forge
rtree                     0.9.7            py38hc59ffc2_0    conda-forge
scipy                     1.5.3            py38hb6cd474_0    conda-forge
setuptools                49.6.0           py38h5347e94_2    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
snowballstemmer           2.0.0                      py_0    conda-forge
sortedcontainers          2.3.0              pyhd8ed1ab_0    conda-forge
sphinx                    3.4.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
spyder                    4.2.1            py38h50d1736_0    conda-forge
spyder-kernels            1.10.1           py38h50d1736_0    conda-forge
sqlite                    3.34.0               h17101e1_0    conda-forge
tbb                       2020.2               h926bf3e_1    conda-forge
tbb-devel                 2020.2               h926bf3e_1    conda-forge
testpath                  0.4.4                      py_0    conda-forge
textdistance              4.2.0              pyhd8ed1ab_0    conda-forge
three-merge               0.1.1              pyh9f0ad1d_0    conda-forge
tk                        8.6.10               h0419947_1    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tornado                   6.1              py38h7e3306e_0    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
typed-ast                 1.4.1            py38h5406a74_1    conda-forge
typing_extensions         3.7.4.3                    py_0    conda-forge
typish                    1.9.1              pyh9f0ad1d_0    conda-forge
ujson                     4.0.1            py38h11c0d25_1    conda-forge
urllib3                   1.26.2             pyhd8ed1ab_0    conda-forge
utfcpp                    3.1.2                         0    conda-forge
vtk                       9.0.1           no_osmesa_py38h523a0c9_102    conda-forge
watchdog                  1.0.2            py38h5406a74_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
wrapt                     1.11.2           py38h4d0b108_1    conda-forge
wurlitzer                 2.0.0            py38h32f6830_2    conda-forge
x264                      1!152.20180806       h1de35cc_0    conda-forge
xz                        5.2.5                haf1e3a3_1    conda-forge
yaml                      0.2.5                haf1e3a3_0    conda-forge
yapf                      0.30.0             pyh9f0ad1d_0    conda-forge
zeromq                    4.3.3                h74dc148_3    conda-forge
zipp                      3.4.0                      py_0    conda-forge
zlib                      1.2.11            h7795811_1010    conda-forge
zstd                      1.4.5                h289c70a_2    conda-forge
adam-urbanczyk commented 3 years ago

Thanks, not much I can do. Do you know at which python code line this happens?

haberman commented 3 years ago

I modified the top-level .py file to spawn a thread that dumps all thread stacks every few seconds. Here is what I am getting while the CPU is pegged at 100% (excluding the thread that prints the stacks):

--- Stack for thread 123145418035200 ---
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/site-packages/ipykernel/iostream.py", line 76, in _thread_main
    self.io_loop.start()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 199, in start
    self.asyncio_loop.run_forever()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/asyncio/base_events.py", line 1823, in _run_once
    event_list = self._selector.select(timeout)
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/selectors.py", line 558, in select
    kev_list = self._selector.control(None, max_ev, timeout)

--- Stack for thread 123145400172544 ---
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "<decorator-gen-17>", line 2, in run
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/site-packages/IPython/core/history.py", line 58, in needs_sqlite
    return f(self, *a, **kw)
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/site-packages/IPython/core/history.py", line 829, in run
    self.history_manager.save_flag.wait()
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 558, in wait
    signaled = self._cond.wait(timeout)
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/threading.py", line 302, in wait
    waiter.acquire()

--- Stack for thread 4442951168 ---
  File "opt/anaconda3/envs/cadquery/bin/CQ-editor", line 24, in <module>
    sys.exit(main())
  File "/Users/haberman/opt/anaconda3/envs/cadquery/lib/python3.8/site-packages/cq_editor/__main__.py", line 27, in main
    sys.exit(app.exec_())
adam-urbanczyk commented 3 years ago

Are you able to produce a backtrace (with lldb/gdb) from the active thread?

haberman commented 3 years ago

Here are the thread stacks. Based on the Instruments screenshot I pasted above, I believe it's thread 1 that appears to be an in infinite loop of some kind. I believe the other threads are blocked and waiting.

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff20219fb4 libobjc.A.dylib`lookUpImpOrForward + 360
    frame #1: 0x00007fff20220ea8 libobjc.A.dylib`class_getInstanceMethod + 51
    frame #2: 0x00007fff2046c5c3 CoreFoundation`__methodDescriptionForSelector + 285
    frame #3: 0x00007fff20486604 CoreFoundation`-[NSObject(NSObject) methodSignatureForSelector:] + 30
    frame #4: 0x0000000115e3d478 libqcocoa.dylib`___lldb_unnamed_symbol343$$libqcocoa.dylib + 86
    frame #5: 0x0000000115e3d0bc libqcocoa.dylib`___lldb_unnamed_symbol339$$libqcocoa.dylib + 2214
    frame #6: 0x000000010cf4ed67 libQt5Gui.5.12.9.dylib`QBackingStore::flush(QRegion const&, QWindow*, QPoint const&) + 137
    frame #7: 0x000000010c99eb82 libQt5Widgets.5.12.9.dylib`___lldb_unnamed_symbol231$$libQt5Widgets.5.12.9.dylib + 682
    frame #8: 0x000000010c9a18c6 libQt5Widgets.5.12.9.dylib`___lldb_unnamed_symbol274$$libQt5Widgets.5.12.9.dylib + 334
    frame #9: 0x000000010c9d2455 libQt5Widgets.5.12.9.dylib`___lldb_unnamed_symbol1149$$libQt5Widgets.5.12.9.dylib + 247
    frame #10: 0x000000010c9d0a42 libQt5Widgets.5.12.9.dylib`___lldb_unnamed_symbol1133$$libQt5Widgets.5.12.9.dylib + 506
    frame #11: 0x000000010c998de6 libQt5Widgets.5.12.9.dylib`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 214
    frame #12: 0x000000010c999c2e libQt5Widgets.5.12.9.dylib`QApplication::notify(QObject*, QEvent*) + 534
    frame #13: 0x000000010c47bfb2 QtWidgets.so`sipQApplication::notify(QObject*, QEvent*) + 114
    frame #14: 0x000000010d3255a4 libQt5Core.5.12.9.dylib`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 138
    frame #15: 0x000000010ce77b4a libQt5Gui.5.12.9.dylib`QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) + 272
    frame #16: 0x000000010ce66b2b libQt5Gui.5.12.9.dylib`bool QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterface::SynchronousDelivery>(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 63
    frame #17: 0x000000010ce69d60 libQt5Gui.5.12.9.dylib`void QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(QWindow*, QRegion const&) + 72
    frame #18: 0x0000000115e45dd2 libqcocoa.dylib`___lldb_unnamed_symbol534$$libqcocoa.dylib + 416
    frame #19: 0x0000000115e4c7d9 libqcocoa.dylib`___lldb_unnamed_symbol730$$libqcocoa.dylib + 572
    frame #20: 0x00007fff26c2ddd2 QuartzCore`-[CALayer display] + 183
    frame #21: 0x00007fff22dff001 AppKit`-[_NSBackingLayer display] + 475
    frame #22: 0x00007fff22d6a535 AppKit`-[_NSViewBackingLayer display] + 555
    frame #23: 0x00007fff26c2d660 QuartzCore`CA::Layer::display_if_needed(CA::Transaction*) + 874
    frame #24: 0x00007fff26d6d73b QuartzCore`CA::Context::commit_transaction(CA::Transaction*, double, double*) + 517
    frame #25: 0x00007fff26c0efd5 QuartzCore`CA::Transaction::commit() + 783
    frame #26: 0x00007fff22e14272 AppKit`__62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
    frame #27: 0x00007fff23563085 AppKit`___NSRunLoopObserverCreateWithHandler_block_invoke + 41
    frame #28: 0x00007fff20473dad CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #29: 0x00007fff20473c3d CoreFoundation`__CFRunLoopDoObservers + 549
    frame #30: 0x00007fff204730ed CoreFoundation`__CFRunLoopRun + 838
    frame #31: 0x00007fff204726ce CoreFoundation`CFRunLoopRunSpecific + 563
    frame #32: 0x00007fff286f76d0 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #33: 0x00007fff286f7322 HIToolbox`ReceiveNextEventCommon + 283
    frame #34: 0x00007fff286f71ef HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #35: 0x00007fff22c8fde9 AppKit`_DPSNextEvent + 883
    frame #36: 0x00007fff22c8e5af AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1366
    frame #37: 0x00007fff22c80b0a AppKit`-[NSApplication run] + 586
    frame #38: 0x0000000115e57c72 libqcocoa.dylib`___lldb_unnamed_symbol975$$libqcocoa.dylib + 1208
    frame #39: 0x000000010d3231dd libQt5Core.5.12.9.dylib`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 265
    frame #40: 0x000000010d3259d2 libQt5Core.5.12.9.dylib`QCoreApplication::exec() + 116
    frame #41: 0x000000010c47cf20 QtWidgets.so`meth_QApplication_exec_(_object*, _object*) + 80
    frame #42: 0x000000010bf7a8d2 python`cfunction_call_varargs + 194
    frame #43: 0x000000010bf79aa7 python`_PyObject_MakeTpCall + 167
    frame #44: 0x000000010c0c9697 python`call_function + 327
    frame #45: 0x000000010c0c5ea6 python`_PyEval_EvalFrameDefault + 42214
    frame #46: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #47: 0x000000010c0c95f2 python`call_function + 162
    frame #48: 0x000000010c0c7271 python`_PyEval_EvalFrameDefault + 47281
    frame #49: 0x000000010c0b9afe python`_PyEval_EvalCodeWithName + 558
    frame #50: 0x000000010c144bf6 python`PyRun_FileExFlags + 358
    frame #51: 0x000000010c14434b python`PyRun_SimpleFileExFlags + 571
    frame #52: 0x000000010c16f4af python`pymain_run_file + 463
    frame #53: 0x000000010c16ea16 python`pymain_run_python + 534
    frame #54: 0x000000010c16e7a5 python`Py_RunMain + 37
    frame #55: 0x000000010c16ff61 python`pymain_main + 49
    frame #56: 0x000000010bf4c5f8 python`main + 56
    frame #57: 0x00007fff20397621 libdyld.dylib`start + 1
  thread #2
    frame #0: 0x00007fff2034a8e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff2037ce6f libsystem_pthread.dylib`_pthread_cond_wait + 1254
    frame #2: 0x00000001728cffed libomp.dylib`__kmp_suspend_64 + 301
    frame #3: 0x00000001728b8830 libomp.dylib`kmp_flag_64::wait(kmp_info*, int, void*) + 1552
    frame #4: 0x00000001728b4706 libomp.dylib`__kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 166
    frame #5: 0x00000001728b7e5d libomp.dylib`__kmp_fork_barrier(int, int) + 445
    frame #6: 0x0000000172897b1a libomp.dylib`__kmp_launch_thread + 314
    frame #7: 0x00000001728cea5a libomp.dylib`__kmp_launch_worker(void*) + 330
    frame #8: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #9: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #3
    frame #0: 0x00007fff2034a8e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff2037ce6f libsystem_pthread.dylib`_pthread_cond_wait + 1254
    frame #2: 0x00000001728cffed libomp.dylib`__kmp_suspend_64 + 301
    frame #3: 0x00000001728b8830 libomp.dylib`kmp_flag_64::wait(kmp_info*, int, void*) + 1552
    frame #4: 0x00000001728b4706 libomp.dylib`__kmp_hyper_barrier_release(barrier_type, kmp_info*, int, int, int, void*) + 166
    frame #5: 0x00000001728b7e5d libomp.dylib`__kmp_fork_barrier(int, int) + 445
    frame #6: 0x0000000172897b1a libomp.dylib`__kmp_launch_thread + 314
    frame #7: 0x00000001728cea5a libomp.dylib`__kmp_launch_worker(void*) + 330
    frame #8: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #9: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #4
    frame #0: 0x00007fff203501fe libsystem_kernel.dylib`__select + 10
    frame #1: 0x000000010c1cc6cb python`time_sleep + 347
    frame #2: 0x000000010bfdba04 python`cfunction_vectorcall_O + 100
    frame #3: 0x000000010c0c95f2 python`call_function + 162
    frame #4: 0x000000010c0c5ea6 python`_PyEval_EvalFrameDefault + 42214
    frame #5: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #6: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #7: 0x000000010c0c7442 python`_PyEval_EvalFrameDefault + 47746
    frame #8: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #9: 0x000000010c0c95f2 python`call_function + 162
    frame #10: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #11: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #12: 0x000000010c0c95f2 python`call_function + 162
    frame #13: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #14: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #15: 0x000000010bf7f117 python`method_vectorcall + 471
    frame #16: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #17: 0x000000010c1cf8e4 python`t_bootstrap + 212
    frame #18: 0x000000010c159154 python`pythread_wrapper + 36
    frame #19: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #20: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #5
    frame #0: 0x00007fff2034a8e2 libsystem_kernel.dylib`__psynch_cvwait + 10
    frame #1: 0x00007fff2037ce6f libsystem_pthread.dylib`_pthread_cond_wait + 1254
    frame #2: 0x000000010c1594e6 python`PyThread_acquire_lock_timed + 214
    frame #3: 0x000000010c1d02b4 python`acquire_timed + 244
    frame #4: 0x000000010c1d065d python`lock_PyThread_acquire_lock + 61
    frame #5: 0x000000010bf893f7 python`method_vectorcall_VARARGS_KEYWORDS + 215
    frame #6: 0x000000010c0c95f2 python`call_function + 162
    frame #7: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #8: 0x000000010c0b9afe python`_PyEval_EvalCodeWithName + 558
    frame #9: 0x000000010bf7b474 python`_PyFunction_Vectorcall + 420
    frame #10: 0x000000010c0c95f2 python`call_function + 162
    frame #11: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #12: 0x000000010c0b9afe python`_PyEval_EvalCodeWithName + 558
    frame #13: 0x000000010bf7b474 python`_PyFunction_Vectorcall + 420
    frame #14: 0x000000010c0c95f2 python`call_function + 162
    frame #15: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #16: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #17: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #18: 0x000000010c0c7442 python`_PyEval_EvalFrameDefault + 47746
    frame #19: 0x000000010c0b9afe python`_PyEval_EvalCodeWithName + 558
    frame #20: 0x000000010bf7b474 python`_PyFunction_Vectorcall + 420
    frame #21: 0x000000010c0c95f2 python`call_function + 162
    frame #22: 0x000000010c0c7271 python`_PyEval_EvalFrameDefault + 47281
    frame #23: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #24: 0x000000010c0c95f2 python`call_function + 162
    frame #25: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #26: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #27: 0x000000010c0c95f2 python`call_function + 162
    frame #28: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #29: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #30: 0x000000010bf7f117 python`method_vectorcall + 471
    frame #31: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #32: 0x000000010c1cf8e4 python`t_bootstrap + 212
    frame #33: 0x000000010c159154 python`pythread_wrapper + 36
    frame #34: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #35: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #6, name = 'ZMQbg/Reaper'
    frame #0: 0x00007fff2034c7e2 libsystem_kernel.dylib`kevent + 10
    frame #1: 0x00000001dc752935 libzmq.5.dylib`zmq::kqueue_t::loop() + 181
    frame #2: 0x00000001dc78194e libzmq.5.dylib`thread_routine(void*) + 78
    frame #3: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #4: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #7, name = 'ZMQbg/IO/0'
    frame #0: 0x00007fff2034c7e2 libsystem_kernel.dylib`kevent + 10
    frame #1: 0x00000001dc752935 libzmq.5.dylib`zmq::kqueue_t::loop() + 181
    frame #2: 0x00000001dc78194e libzmq.5.dylib`thread_routine(void*) + 78
    frame #3: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #4: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #8
    frame #0: 0x00007fff2034c7e2 libsystem_kernel.dylib`kevent + 10
    frame #1: 0x00000001db069f1e select.cpython-38-darwin.so`select_kqueue_control + 942
    frame #2: 0x000000010bf89669 python`method_vectorcall_FASTCALL + 137
    frame #3: 0x000000010c0c95f2 python`call_function + 162
    frame #4: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #5: 0x000000010c0b9afe python`_PyEval_EvalCodeWithName + 558
    frame #6: 0x000000010bf7b474 python`_PyFunction_Vectorcall + 420
    frame #7: 0x000000010c0c95f2 python`call_function + 162
    frame #8: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #9: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #10: 0x000000010c0c95f2 python`call_function + 162
    frame #11: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #12: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #13: 0x000000010c0c95f2 python`call_function + 162
    frame #14: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #15: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #16: 0x000000010c0c95f2 python`call_function + 162
    frame #17: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #18: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #19: 0x000000010bf7f117 python`method_vectorcall + 471
    frame #20: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #21: 0x000000010c0c7442 python`_PyEval_EvalFrameDefault + 47746
    frame #22: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #23: 0x000000010c0c95f2 python`call_function + 162
    frame #24: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #25: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #26: 0x000000010c0c95f2 python`call_function + 162
    frame #27: 0x000000010c0c5e17 python`_PyEval_EvalFrameDefault + 42071
    frame #28: 0x000000010bf7b3c2 python`_PyFunction_Vectorcall + 242
    frame #29: 0x000000010bf7f117 python`method_vectorcall + 471
    frame #30: 0x000000010bf7a479 python`PyVectorcall_Call + 121
    frame #31: 0x000000010c1cf8e4 python`t_bootstrap + 212
    frame #32: 0x000000010c159154 python`pythread_wrapper + 36
    frame #33: 0x00007fff2037c950 libsystem_pthread.dylib`_pthread_start + 224
    frame #34: 0x00007fff2037847b libsystem_pthread.dylib`thread_start + 15
  thread #9
    frame #0: 0x00007fff2034953e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff203794fd libsystem_pthread.dylib`_pthread_wqthread + 414
    frame #2: 0x00007fff20378467 libsystem_pthread.dylib`start_wqthread + 15
haberman commented 3 years ago

Yes after further investigation I have more evidence that it is thread 1 only that is spinning and the others are stopped:

$ ps -M 33230
USER       PID   TT   %CPU STAT PRI     STIME     UTIME COMMAND
haberman 33230 s000  100.0 R    46T   0:01.94   2:59.03 /Users/haberman/opt/anaconda3/envs/cadquery/bin/python /Users/haberman/opt/anaconda3/envs/cadquery/bin/cq-editor
         33230         0.0 S    31T   0:00.00   0:00.19 
         33230         0.0 S    31T   0:00.00   0:00.19 
         33230         0.0 S    31T   0:00.02   0:00.01 
         33230         0.0 S    31T   0:00.00   0:00.00 
         33230         0.0 S    31T   0:00.00   0:00.00 
         33230         0.0 S    31T   0:00.00   0:00.00 
         33230         0.0 S    31T   0:00.00   0:00.00 
         33230         0.0 S    37T   0:00.00   0:00.00 
ornamentist commented 3 years ago

FWIW I'm seeing the same results with an M1 mac running Big Sur with the cadquery=master install. This is in a shell started with arch -x86_64.

I can't run the older cadquery=2 version of cadquery library as conda gives up with conflicts after 15 minutes or so of trying.

adam-urbanczyk commented 3 years ago

@haberman thanks for the investigation. Based on your input I managed to find this: https://bugreports.qt.io/browse/QTBUG-87014

adam-urbanczyk commented 3 years ago

Digging deeper: https://stackoverflow.com/questions/64833558/apps-not-popping-up-on-macos-big-sur-11-0-1

Seems that setting this envvar is a workaround: QT_MAC_WANTS_LAYER=1

haberman commented 3 years ago

QT_MAC_WANTS_LAYER=1 did the trick for me!

WillAdams commented 3 years ago

Just downloaded build 51 and spent the better part of an hour okaying libraries to run and finally arrived at:

Warning: QApplication was created before pyqtgraph was imported; there may be problems (to avoid bugs, call QApplication.setGraphicsSystem("raster") before the QApplication is created). Namespace(filename=None)

adam-urbanczyk commented 3 years ago

Please ignore the warning - is it working in the end?

WillAdams commented 3 years ago

No, I never get a window --- it just hangs.

adam-urbanczyk commented 3 years ago

I assume you tried the QT_MAC_WANTS_LAYER=1 trick. If that does not help, I have no other ideas, nor do I have a mac to debug this.

WillAdams commented 3 years ago

I managed to find: https://github.com/napari/napari/issues/1393#issuecomment-729134340 but not quite grasping what's involved from reading it --- what environment and where does this get set?

adam-urbanczyk commented 3 years ago

Try with this version, it sets the env variable for you https://github.com/CadQuery/CQ-editor/releases/tag/0.2

WillAdams commented 3 years ago

That worked! William

-----Original Message----- From: Adam Urbańczyk notifications@github.com To: CadQuery/CQ-editor CQ-editor@noreply.github.com Cc: William Adams willadams@aol.com; Comment comment@noreply.github.com Sent: Mon, Feb 15, 2021 3:16 pm Subject: Re: [CadQuery/CQ-editor] CadQuery2 / CQ-Editor not launching on macOS BigSur (#209)

Try with this version, it sets the env variable for you https://github.com/CadQuery/CQ-editor/releases/tag/0.2— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

revolter commented 3 years ago

For me, it keeps showing "macOS cannot verify the developer of" warnings, and I have to repeat running the script and allowing each one from the Settings. Can't this be avoided somehow?

jmwright commented 3 years ago

@revolter I have to borrow a Mac to do testing and builds so I'm not overly familiar with MacOS, but in my experience launching CQ-editor from the command line works around this issue.

revolter commented 3 years ago

I actually was trying to open it from terminal, I don't know what happened. But somehow, I installed conda and it works now.

jdthorpe commented 3 years ago

I had been using the cq-editor a few weeks ago, but it wouldn't launch today. Three hours of frustration ended with:

export QT_MAC_WANTS_LAYER=1
cq-editor

Before this, I tried installing the cq-editor in a new conda environment, re-installing conda, re-booting my mac, installing all pending updates on my mac. I suggest adding the export QT_MAC_WANTS_LAYER=1 line to the install section of the README or just pushing the environment var to the main conda package.

jmwright commented 3 years ago

Just as a note, this export does exist in the launcher script in the release builds for MacOS.

ornamentist commented 3 years ago

Has anyone on a recent macOS been able to resolve the issue with unsigned Python dylibs in the CQ-editor download from Github?

This happens when launching from the command line either via the script or running the executable directly.

ornamentist commented 3 years ago

Rather than the packaged downloads I tried again with miniconda and the CQ-editor conda package install. With the QT_MAC_WANTS_LAYER environment variable set that does open.

I'm guessing it needs the conda versions of signed Python dylibs and not the system versions or the packaged download versions.