Skip to content
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

M1/Apple Silicon version of Qutebrowser? #6478

Open
angelus2014 opened this issue May 25, 2021 · 30 comments
Open

M1/Apple Silicon version of Qutebrowser? #6478

angelus2014 opened this issue May 25, 2021 · 30 comments
Labels
component: infrastructure Issues related to development scripts, CI, servers, etc. os: macOS Issues which only happen on macOS. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.

Comments

@angelus2014
Copy link

Hello,

Will there be a M1/Apple Silicon version of Qutebrowser for macOS?


Angelo

@The-Compiler
Copy link
Member

Unlikely, at least for the moment. So far, its dependencies aren't ready (see e.g. https://bugreports.qt.io/browse/QTBUG-85279), but even when they are (if at all, with PyQt and QtWebEngine), I lack the resources to maintain separate M1 builds for a comparatively small part of qutebrowser's users.

@The-Compiler
Copy link
Member

To elaborate a bit: Happy to reopen this as a wishlist item once the upstream issues are actually taken care of - but right now it's totally unclear whether e.g. PyQt plans to publish wheels (binary releases) for M1. Let's wait for Qt first and see where that goes then.

However chances still are I won't be able to maintain those builds (among other issues, because I don't own the hardware). Once the dependencies are ready, however, you should be able to do tox -e build-release to build a release yourself even if I don't do so. But so far, support for macOS and Windows is on a best-effort basis, and I don't see that changing I'm afraid (unless someone trustworthy steps up to take care of macOS stuff and builds).

@The-Compiler
Copy link
Member

Looks like Qt will be ready with Qt 6.2, and PyInstaller is ready with the latest release too: pyinstaller/pyinstaller#5581

Still no concrete plans for official M1 releases at this stage (unless I can build them on a non-M1 Mac!), but at least making it possible to build such a release manually sounds like a good idea.

Let's revisit this once Qt 6.2 is out and qutebrowser supports it (#5395), i.e. somewhen around October or so.

@The-Compiler The-Compiler reopened this Jul 19, 2021
@The-Compiler The-Compiler added component: infrastructure Issues related to development scripts, CI, servers, etc. os: macOS Issues which only happen on macOS. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible. labels Jul 19, 2021
@shaunsingh
Copy link

Looks like 6.2 is releasing soon. BTW github actions has m1 mac's available, and I would love to build a binary if you ever need

@The-Compiler
Copy link
Member

Looks like 6.2 is releasing soon.

Indeed. Note that support for it will first require major changes to qutebrowser (#5395). I did a quick and dirty approach in late August which kind-of-worked, but proper support will still take a bit of time I'm afraid.

BTW github actions has m1 mac's available

It does not: actions/runner-images#2187

@shaunsingh
Copy link

It does not: actions/runner-images#2187
macos-11
Ah, I see they have macOS big sur images, but those are still intel, sorry for the confusion.
#5395
Thanks!

@tgy
Copy link

tgy commented Jan 3, 2022

Hey! What's the current status on the M1-compatible builds? :-)

@The-Compiler
Copy link
Member

@tgy See the comments above - not much changed about that.

@stefanpinter
Copy link

hi! does qutebrowser at least work on M1 via emulation/wrapper?

@The-Compiler
Copy link
Member

@stefanpinter I don't have the hardware to test, but I'm not aware of any M1-specific issues reported.

@stefanpinter
Copy link

ah thanks @The-Compiler! so why does this issue exist? any problems/cons with going over emulation?

i love qutebrowser

@The-Compiler
Copy link
Member

Emulation always comes with an overhead - so, less performance than would be possible with a native version, and thus also more battery usage.

@deividaspetraitis
Copy link

Update: pre-release for github actions for M1 Silicon should be available next week as per this actions/runner#805 (comment)

@The-Compiler
Copy link
Member

@deividaspetraitis That's only for self-hosted runners, i.e. still means I'd need to buy/rent a M1 Mac to use it.

@donaldguy
Copy link

FYI to (other) concerned parties, I did finally get the Qt6 branch to build and run (and seems to work, but haven't tested extensively) on my M1 Air.

(took a rundabout journey to get there: #7202 (comment))
but I think its down to just:

brew install python # 3.9.13_1, also brings in sqlite @ 3.38.5
gh repo clone qutebrowser/qutebrowser
cd qutebrowser
git checkout qt6-v2
/opt/homebrew/opt/python@3.9/libexec/bin/python scripts/mkvenv.py --pyqt-version 6.3
./.venv/bin/qutebrowser --temp-basedir

you might consider throwing a brew install qt at the top as well (not so much for the libs as what you need should be pulled from pypi as PyQt6-Qt6 wheel; but maybe for the deps? so far not noticed it being needed but idk)

@The-Compiler
Copy link
Member

@donaldguy Ah, neat, I didn't realize that PyQt 6 comes with ARM64 wheels already! That certainly gets us a step closer here. The only missing bit - once we have Qt 6 support merged, that is - would then be how to package it all up (ideally without me needing a M1 Mac, or with GitHub Actions having a M1 runner until then).

I'm a bit confused about "This seems to get me back to a working browser!" over in #7202 though: The current .dmg release should work for you as well, other than not running natively and probably #6771, correct?

@jonathanabennett
Copy link

Once I finish this summer vacation and I'm back on my school-provided Macbook, I am happy to be a tester/compiler for the M1. I'm at least intermediate in Python (been programming in it for 20 years and have 3 small to medium sized projects I've built for schools I've worked at. And I have access to an M1 Silicon Mac. I just chose to bring my Linux laptop on the summer, mostly because I wanted to try setting up and configuring Qutebrowser.

@david-alvarez-rosa
Copy link

Hi there! My work laptop is M1. I shouldn't be using it too much for personal stuff haha, but I would love to use Qutebrowser at work... if there is something I can do to help, @The-Compiler, please do let me know! 😄

@The-Compiler
Copy link
Member

@david-alvarez-rosa as outlined above, you should be able to use it just fine without having an M1 build.

@david-alvarez-rosa
Copy link

Jesus... I have been using Firefox for months... I thought qutebrowser was not working for M1. @The-Compiler this is great news for me! Thank you ❤️

@DrTobe
Copy link

DrTobe commented Jul 26, 2022

FYI to (other) concerned parties, I did finally get the Qt6 branch to build and run (and seems to work, but haven't tested extensively) on my M1 Air.

brew install python # 3.9.13_1, also brings in sqlite @ 3.38.5
gh repo clone qutebrowser/qutebrowser
cd qutebrowser
git checkout qt6-v2
/opt/homebrew/opt/python@3.9/libexec/bin/python scripts/mkvenv.py --pyqt-version 6.3
./.venv/bin/qutebrowser --temp-basedir

I can confirm that @donaldguy's build steps from #6478 (comment) work. As far as I can tell, this is already working surprisingly well.

How can I package this into a MacOS application bundle? I guess I could extract the required steps from the Github Actions instructions but it would be easier if this was already written down somewhere.

I could also share the result then if desired.

@The-Compiler
Copy link
Member

@DrTobe The releasing scripts currently only work with PyQt from PyPI, so it's not just a matter of running them, they will need changes first to work with Homebrew's Qt.

@shaggyshoggoth
Copy link

I managed to build an application bundle.

I looked on PyPI and found what seemed to be Apple silicon builds on it. After following @donaldguy 's instructions above, I poked around and edited tox.ini to change
[testenv:pyinstaller-{64,32}{,-qt6}]
to
[testenv:pyinstaller-{64,32,arm64}{,-qt6}]
and then updated scripts/dev/build_release.sh
and changed
call_tox(f'pyinstaller-64{"-qt6" if qt6 else ""}', '-r', debug=debug)
to
call_tox(f'pyinstaller-arm64{"-qt6" if qt6 else ""}', '-r', debug=debug)

Then, from in the top-level git directory I ran

source .venv/bin/activate
pip install asciidoc
pip install tox
scripts/dev/build_release.py

(The asciidoc may be optional? I did that install long before I had a working build.)

This generated a dmg in dist, which checks identifies as running on Apple silicon in Activity Monitor.

Note: this is me messing around without knowing exactly what I'm doing.

@DrTobe
Copy link

DrTobe commented Dec 2, 2022

Then, from in the top-level git directory I ran

source .venv/bin/activate
pip install asciidoc
pip install tox
scripts/dev/build_release.py

I guess the last line needs to be scripts/dev/build_release.py --qt6?

@kel50
Copy link

kel50 commented Feb 28, 2023

brew install python # 3.9.13_1, also brings in sqlite @ 3.38.5
gh repo clone qutebrowser/qutebrowser
cd qutebrowser
git checkout qt6-v2
/opt/homebrew/opt/python@3.9/libexec/bin/python scripts/mkvenv.py --pyqt-version 6.3
./.venv/bin/qutebrowser --temp-basedir

I can confirm that @donaldguy 's build steps also work for M2 Max.

@DrTobe
Copy link

DrTobe commented Aug 30, 2023

source .venv/bin/activate
pip install asciidoc
pip install tox
scripts/dev/build_release.py

I have tried this again with the recently released v3.0.0. Unfortunately, this does not work anymore to get a working app bundle. I have also tried out some similar commands (e.g. the ones found in the Github Actions workflow) but in all cases, the qutebrowser.app/Contents/MacOS directory only contained the qutebrowser binary. When trying to run it, it complains about not finding qutebrowser.app/Contents/MacOS/Python (which actually is not there, but should be in a correct bundle).

Is this expected? Any ideas how to successfully build a bundle on Apple silicon macOS?

@toofar
Copy link
Member

toofar commented Aug 30, 2023

@DrTobe @hpfmn put a workaround here: #7859
Hopefully that gets you going for now, not really sure what's going on there but hopefully someone figures it out before the next release.

@The-Compiler
Copy link
Member

Introducing the new, Apple silicon powered M1 macOS larger runner for GitHub Actions - The GitHub Blog

Will need to see how the pricing thing works, so far I never paid for GitHub Actions usage. I suppose if we only use it for releases (instead of tests) it will be fine either way.

@toofar
Copy link
Member

toofar commented Mar 25, 2024

Apparently the macos-14 runner (which is available for public repos too) runs on an M1 CPU now: actions/runner-images#9254

I guess that means if we want to support older macOS releases (which we probably do since I seem to remember people complaining when we drop them) we'll need two installers for mac, one intel for macos11+ and one m1 for macos14+.

Although I'm not actually sure why we couldn't make a universal build with both architectures supported in the x86 runner in the first place. I seem to remember we discussed it and there was some issue, but I can't find that discussion. Apple says you can do that, with a simplified example.

@The-Compiler
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: infrastructure Issues related to development scripts, CI, servers, etc. os: macOS Issues which only happen on macOS. priority: 3 - wishlist Issues which are not important and/or where it's unclear whether they're feasible.
Projects
None yet
Development

No branches or pull requests