New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build an .app for OS X. #384

Closed
The-Compiler opened this Issue Dec 19, 2014 · 11 comments

Comments

Projects
None yet
5 participants
@The-Compiler
Collaborator

The-Compiler commented Dec 19, 2014

12:12 <asdfqwerhkjdsafa> any plans to turn qutebrowser into an actual .app, with its own icon and what not?
12:13 <asdfqwerhkjdsafa> I guess if you're all on linux, I know the answer to that one
12:15 <oed> I don't see why not? If it really aims to be crossplatform it should use the standard way to install on all systems. .app for osx, .deb for ubuntu/debian, however windows does stuff for windows
12:22 <The-Compiler> cx_Freeze which I use for Windows can do .app's and .dmg's too
@durden

This comment has been minimized.

Show comment
Hide comment
@durden

durden Dec 19, 2014

Maybe consider PyInstaller as well. I've used Pyinstaller a lot to package up GUI apps using Python 2.7 with PyQt4, numpy, scipy, and matplotlib.

I've never used Pyinstaller with Python 3, but they do have a experimental branch for this here.

However, if you've had a lot of success with cx_freeze there may not be any big benefits of Pyinstaller over that, just throwing out some ideas.

durden commented Dec 19, 2014

Maybe consider PyInstaller as well. I've used Pyinstaller a lot to package up GUI apps using Python 2.7 with PyQt4, numpy, scipy, and matplotlib.

I've never used Pyinstaller with Python 3, but they do have a experimental branch for this here.

However, if you've had a lot of success with cx_freeze there may not be any big benefits of Pyinstaller over that, just throwing out some ideas.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Apr 13, 2015

Collaborator

I've now tried bdist_dmg with cx_Freeze.

At first it doesn't start at all:

objc[8906]: Class NotificationReceiver is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtWidgets and /usr/local/Cellar/qt5/5.4.0/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.
objc[8906]: Class QCocoaPageLayoutDelegate is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtPrintSupport and /usr/local/Cellar/qt5/5.4.0/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
objc[8906]: Class QCocoaPrintPanelDelegate is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtPrintSupport and /usr/local/Cellar/qt5/5.4.0/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
WARNING: QObject::moveToThread: Current thread (0x7fe7f046cff0) is not the object's thread (0x7fe7f2a58650).
Cannot move to target thread (0x7fe7f046cff0)

WARNING: On Mac OS X, you might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.

CRITICAL: This application failed to start because it could not find or load the Qt platform plugin "cocoa".

Available platform plugins are: cocoa, minimal, offscreen.

Reinstalling the application may fix this problem.

Fatal Python error: Aborted

Current thread 0x00007fff7389e300 (most recent call first):
  File "scripts/../scripts/../qutebrowser/app.py", line 95 in __init__
  File "scripts/../scripts/../qutebrowser/qutebrowser.py", line 135 in main
  File "qutebrowser/__main__.py", line 29 in <module>
  File "/Users/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/cx_Freeze/initscripts/Console.py", line 27 in <module>
Abort trap: 6

After creating an empty Contents/Resources/qt.conf inside the .app, it runs, but still with some errors:

objc[8909]: Class NotificationReceiver is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtWidgets and /usr/local/Cellar/qt5/5.4.0/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.
WARNING: void QCocoaWindow::syncWindowState(Qt::WindowState) invalid window content view size, check your window geometry

INFO: Run :adblock-update to get adblock lists.
2015-04-13 12:13:08.826 qutebrowser.exe[8909:810046] Error loading /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin:  dlopen(/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin, 265): no suitable image found.  Did find:
        /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: mach-o, but wrong architecture

Also, there is no icon set, and the top bar says qutebrowser.exe for the application name.

Collaborator

The-Compiler commented Apr 13, 2015

I've now tried bdist_dmg with cx_Freeze.

At first it doesn't start at all:

objc[8906]: Class NotificationReceiver is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtWidgets and /usr/local/Cellar/qt5/5.4.0/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.
objc[8906]: Class QCocoaPageLayoutDelegate is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtPrintSupport and /usr/local/Cellar/qt5/5.4.0/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
objc[8906]: Class QCocoaPrintPanelDelegate is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtPrintSupport and /usr/local/Cellar/qt5/5.4.0/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined.
WARNING: QObject::moveToThread: Current thread (0x7fe7f046cff0) is not the object's thread (0x7fe7f2a58650).
Cannot move to target thread (0x7fe7f046cff0)

WARNING: On Mac OS X, you might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.

CRITICAL: This application failed to start because it could not find or load the Qt platform plugin "cocoa".

Available platform plugins are: cocoa, minimal, offscreen.

Reinstalling the application may fix this problem.

Fatal Python error: Aborted

Current thread 0x00007fff7389e300 (most recent call first):
  File "scripts/../scripts/../qutebrowser/app.py", line 95 in __init__
  File "scripts/../scripts/../qutebrowser/qutebrowser.py", line 135 in main
  File "qutebrowser/__main__.py", line 29 in <module>
  File "/Users/florian/proj/qutebrowser/.venv/lib/python3.4/site-packages/cx_Freeze/initscripts/Console.py", line 27 in <module>
Abort trap: 6

After creating an empty Contents/Resources/qt.conf inside the .app, it runs, but still with some errors:

objc[8909]: Class NotificationReceiver is implemented in both /Users/florian/Desktop/qutebrowser-0.1.4.app/./Contents/MacOS/QtWidgets and /usr/local/Cellar/qt5/5.4.0/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.
WARNING: void QCocoaWindow::syncWindowState(Qt::WindowState) invalid window content view size, check your window geometry

INFO: Run :adblock-update to get adblock lists.
2015-04-13 12:13:08.826 qutebrowser.exe[8909:810046] Error loading /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin:  dlopen(/Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin, 265): no suitable image found.  Did find:
        /Library/Internet Plug-Ins/QuickTime Plugin.plugin/Contents/MacOS/QuickTime Plugin: mach-o, but wrong architecture

Also, there is no icon set, and the top bar says qutebrowser.exe for the application name.

The-Compiler added a commit that referenced this issue Apr 13, 2015

The-Compiler added a commit that referenced this issue Apr 13, 2015

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Apr 13, 2015

Collaborator

The .app generated by freeze.py now works fine - things left to do:

  • Look at warnings
  • Set an icon
  • Change the application name to not include the version.
Collaborator

The-Compiler commented Apr 13, 2015

The .app generated by freeze.py now works fine - things left to do:

  • Look at warnings
  • Set an icon
  • Change the application name to not include the version.

The-Compiler added a commit that referenced this issue Apr 13, 2015

The-Compiler added a commit that referenced this issue Apr 13, 2015

@The-Compiler The-Compiler removed their assignment Oct 1, 2015

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jan 13, 2016

Collaborator

@flv0 and I did some quick tests today, and it seems we run into cx_Freeze issue 156. When running the version from the repo, we get 159/171 instead.

I guess it's really time to look at a replacement (#1004) 😒

Collaborator

The-Compiler commented Jan 13, 2016

@flv0 and I did some quick tests today, and it seems we run into cx_Freeze issue 156. When running the version from the repo, we get 159/171 instead.

I guess it's really time to look at a replacement (#1004) 😒

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Mar 31, 2016

Collaborator

FYI, I'm playing with PyInstaller and (on OS X at least) it seems to go pretty well.

It can't do DMGs though, but this might help:

Collaborator

The-Compiler commented Mar 31, 2016

FYI, I'm playing with PyInstaller and (on OS X at least) it seems to go pretty well.

It can't do DMGs though, but this might help:

@The-Compiler The-Compiler referenced this issue Apr 13, 2016

Open

Set as default browser #22

0 of 3 tasks complete
@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler May 28, 2016

Collaborator

Okay, I think I finally got a running DMG with Qt 5.6 - can you please try qutebrowser-20160528.dmg?

Collaborator

The-Compiler commented May 28, 2016

Okay, I think I finally got a running DMG with Qt 5.6 - can you please try qutebrowser-20160528.dmg?

@juanolon

This comment has been minimized.

Show comment
Hide comment
@juanolon

juanolon Jun 1, 2016

hi, i was waiting for these release for a long time ^^ anyway, i tried the last released dmg file (last comment) and it worked :) as an "normal" user, i don't see any errors, logo is there and it didn't crash after some usage.. great work 👍

juanolon commented Jun 1, 2016

hi, i was waiting for these release for a long time ^^ anyway, i tried the last released dmg file (last comment) and it worked :) as an "normal" user, i don't see any errors, logo is there and it didn't crash after some usage.. great work 👍

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 1, 2016

Collaborator

Glad to hear! Closing this issue then, I plan to release a new dmg with the 0.7 release which should hopefully happen soon.

Collaborator

The-Compiler commented Jun 1, 2016

Glad to hear! Closing this issue then, I plan to release a new dmg with the 0.7 release which should hopefully happen soon.

@rien333

This comment has been minimized.

Show comment
Hide comment
@rien333

rien333 Apr 3, 2018

Contributor

How do you build qutebrowser as an dmg/app ? I've been using the scripts/dev/build_release.py script, but to produce anything out of it has until now required me multiple runs and/or manual editing. Furthermore, the current HEAD produces this error for me:

37424 INFO: Looking for dynamic libraries
37594 ERROR: Can not find path /usr/local/mysql/lib/libmysqlclient.20.dylib (needed by /Users/rw/dev/qutebrowser/.tox/pyinstaller/lib/python3.6/site-packages/PyQt5/Qt/plugins/sqldrivers/libqsqlmysql.dylib)
38672 INFO: Looking for eggs
38673 INFO: Using Python library /Users/rw/dev/qutebrowser/.tox/pyinstaller/bin/../.Python
38719 INFO: Warnings written to /Users/rw/dev/qutebrowser/build/qutebrowser/warn-qutebrowser.txt
39007 INFO: Graph cross-reference written to /Users/rw/dev/qutebrowser/build/qutebrowser/xref-qutebrowser.html
39115 INFO: Appending 'datas' from .spec
Empty DEST not allowed when adding binary and data files. Maybe you want to used '.'.
Caused by '../qutebrowser/git-commit-id'.
ERROR: InvocationError: '/Users/rw/dev/qutebrowser/.tox/pyinstaller/bin/pyinstaller --noconfirm misc/qutebrowser.spec'
pyinstaller finish: runtests after 39.88 seconds
____________________________________________________ summary _____________________________________________________
ERROR:   pyinstaller: commands failed
Traceback (most recent call last):
  File "scripts/dev/build_release.py", line 434, in <module>
    main()
  File "scripts/dev/build_release.py", line 414, in main
    artifacts = build_mac()
  File "scripts/dev/build_release.py", line 179, in build_mac
    call_tox('pyinstaller', '-r')
  File "scripts/dev/build_release.py", line 70, in call_tox
    env=env, check=True)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/local/opt/python/bin/python3.6', '-m', 'tox', '-vv', '-e', 'pyinstaller', '-r']' returned non-zero exit status 1.
Contributor

rien333 commented Apr 3, 2018

How do you build qutebrowser as an dmg/app ? I've been using the scripts/dev/build_release.py script, but to produce anything out of it has until now required me multiple runs and/or manual editing. Furthermore, the current HEAD produces this error for me:

37424 INFO: Looking for dynamic libraries
37594 ERROR: Can not find path /usr/local/mysql/lib/libmysqlclient.20.dylib (needed by /Users/rw/dev/qutebrowser/.tox/pyinstaller/lib/python3.6/site-packages/PyQt5/Qt/plugins/sqldrivers/libqsqlmysql.dylib)
38672 INFO: Looking for eggs
38673 INFO: Using Python library /Users/rw/dev/qutebrowser/.tox/pyinstaller/bin/../.Python
38719 INFO: Warnings written to /Users/rw/dev/qutebrowser/build/qutebrowser/warn-qutebrowser.txt
39007 INFO: Graph cross-reference written to /Users/rw/dev/qutebrowser/build/qutebrowser/xref-qutebrowser.html
39115 INFO: Appending 'datas' from .spec
Empty DEST not allowed when adding binary and data files. Maybe you want to used '.'.
Caused by '../qutebrowser/git-commit-id'.
ERROR: InvocationError: '/Users/rw/dev/qutebrowser/.tox/pyinstaller/bin/pyinstaller --noconfirm misc/qutebrowser.spec'
pyinstaller finish: runtests after 39.88 seconds
____________________________________________________ summary _____________________________________________________
ERROR:   pyinstaller: commands failed
Traceback (most recent call last):
  File "scripts/dev/build_release.py", line 434, in <module>
    main()
  File "scripts/dev/build_release.py", line 414, in main
    artifacts = build_mac()
  File "scripts/dev/build_release.py", line 179, in build_mac
    call_tox('pyinstaller', '-r')
  File "scripts/dev/build_release.py", line 70, in call_tox
    env=env, check=True)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/local/opt/python/bin/python3.6', '-m', 'tox', '-vv', '-e', 'pyinstaller', '-r']' returned non-zero exit status 1.
@toofar

This comment has been minimized.

Show comment
Hide comment
@toofar

toofar Apr 4, 2018

Collaborator

Looks like this is the commit that introduced that error message: pyinstaller/pyinstaller@771986d
The-Compiler is the one who maintains the build script and I don't think he has a working up to date mac build machine at the moment. So if you think you can get it working a pull request would be welcome. Although I wonder if this change affects the windows build step too...

Either way it would be worth opening a new issue since we are apparently using pyinstaller wrong.

Collaborator

toofar commented Apr 4, 2018

Looks like this is the commit that introduced that error message: pyinstaller/pyinstaller@771986d
The-Compiler is the one who maintains the build script and I don't think he has a working up to date mac build machine at the moment. So if you think you can get it working a pull request would be welcome. Although I wonder if this change affects the windows build step too...

Either way it would be worth opening a new issue since we are apparently using pyinstaller wrong.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Apr 8, 2018

Collaborator

Gnah, I was sure I had fixed that one already, but apparently that got lost somehow? Pushing a fix now.

Collaborator

The-Compiler commented Apr 8, 2018

Gnah, I was sure I had fixed that one already, but apparently that got lost somehow? Pushing a fix now.

The-Compiler added a commit that referenced this issue Apr 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment