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

🍎 Mac Qt6 .dmg #60039

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

🍎 Mac Qt6 .dmg #60039

wants to merge 30 commits into from

Conversation

m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented Jan 2, 2025

Description

Please download the release from the MacOS link in this comment #60039 (comment) for testing-- there are other links in other comments to older broken builds.

Creates macos installers (dmg), based on Qt6/vcpkg for desktop components

  • It provides QGIS, qgis_process, qgis_bench, ogr2ogr and a few executable binaries
  • The package is created for master, pull requests and releases
  • It creates two builds, one for x64 (intel) and one for arm64 (M) processors it creates a "universal" executable that works natively on both x64 and arm64 (socalled "multiarchitecture" or "fat" binaries)
  • It simplifies a lot of cmake code by not building frameworks. If there is a good reason to reintroduce frameworks, I am happy to discuss how to deal with specific use cases for which they are currently used.
  • It separates the Python_SITEARCH directory with an absolute system path (where site-packages is installed on the system) from a new variable QGIS_PYTHON_INSTALL_DIR with relative variable where our python bindings will be installed to (which can be the same path as Python_SITEARCH if the prefix provided through CMAKE_INSTALL_PREFIX and/or DESTDIR matches)
  • It completely removed CMAKE_INSTALL_DIR from cmake code in install directives, to allow for installation on relative paths
  • It does not include QGIS server, if you want to run QGIS server on macos, there are homebrew, conda and other options
  • This removes the current mac bundles (the dependencies in there are outdated)
  • It separates building the application (for development/debugging) from bundling. The macos bundle is only created at bundling time. For debugging, no libraries are copied into the build path.
  • For creating an app and fixing rpath, macdeployqt is used (only minimal usage within cmake) For fixing rpath, a custom script similar to maceployqt is used. Macdeployqt was too slow and didn't handle some cases (like symlinks)
  • For creating a shiny dmg, create-dmg is used
  • No notarisation or code signing is done (yet)

Fixes #46299

@github-actions github-actions bot added this to the 3.42.0 milestone Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

🧮 Vcpkg update report

Added packages:
🍓 qtcharts: 6.8.1 (Features: )

Updated packages:
🍇 py-poetry-core: 1.9.1 -> 2.0.0
🍇 py-pyqt-builder: 1.17.0 -> 1.17.1
🍇 py-tomli: 2.0.1 -> 2.0.1#1
🍇 py-trove-classifiers: 2024.10.21.16 -> 2025.1.7.14

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit f06bb30)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit f06bb30)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit f06bb30)

cmake/VcpkgInstallDeps.cmake Outdated Show resolved Hide resolved
@m-kuhn m-kuhn changed the title Mac Qt6 .dmg 🍎 Mac Qt6 .dmg Jan 2, 2025
@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 3, 2025

Creating the dmg on x64 github action runners (macos-13) randomly fails because of "resource busy" in hdiutil. There is not much we can do but retry until we succeed -- which can eventually take a very long time.

@nyalldawson
Copy link
Collaborator

@m-kuhn

Creating the dmg on x64 github action runners (macos-13) randomly fails because of "resource busy" in hdiutil. There is not much we can do but retry until we succeed -- which can eventually take a very long time.

Should we just disable these then? (At least it's only the legacy build)

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 5, 2025

Possibly, I'm trying to create a zip or a universal app. Last resort would be killing x64

@eflaten
Copy link

eflaten commented Jan 6, 2025

I tried a x64 build during the weekend, and that one worked :) The one that worked was when the downloadable .dmg was separated between M prosessor and Intel. I am on macos 15.2

The one that are for download now first dident launch because of permission errors, but launched after I did:
chmod 755 /Applications/QGIS-PR60039.app/Contents/MacOS/QGIS-PR60039
so it is -rwxr-xr-x@
Then it starts, but crashes:

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: @rpath/libQt6OpenGLWidgets.6.8.1.dylib
Referenced from: <CF52E830-6AD3-32CD-9072-DA23F27414B0> /Applications/QGIS-PR60039.app/Contents/MacOS/QGIS-PR60039
Reason: tried: '/Applications/QGIS-PR60039.app/Contents/MacOS/../Frameworks/libQt6OpenGLWidgets.6.8.1.dylib' (no such file), '/Applications/QGIS-PR60039.app/Contents/MacOS/../Frameworks/libQt6OpenGLWidgets.6.8.1.dylib' (no such file)

If there is any particular tests I can do. I am happy to help. If I can. Nice to see progress one the macos work on QGIS, Mathias :)

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 7, 2025

@eflaten if you happen to have an arm64 (M series) machine, a test of https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714 would be appreciated.

@eflaten
Copy link

eflaten commented Jan 7, 2025

@eflaten if you happen to have an arm64 (M series) machine, a test of https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714 would be appreciated.

Oh sorry. No arm64 machine here. Just a x64.

@NyakudyaA
Copy link
Contributor

@eflaten if you happen to have an arm64 (M series) machine, a test of https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714 would be appreciated.

Oh sorry. No arm64 machine here. Just a x64.

I can test this, but the link keeps timing out from downloading the DMG

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 7, 2025

@eflaten if you happen to have an arm64 (M series) machine, a test of https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714 would be appreciated.

Oh sorry. No arm64 machine here. Just a x64.

I can test this, but the link keeps timing out from downloading the DMG

Strange, link works here... Can you download the arm64 zip from here https://github.com/qgis/QGIS/actions/runs/12642053020?

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 7, 2025

The latest dmg (dmg https://github.com/qgis/QGIS/actions/runs/12656340998/artifacts/2397658648 from run https://github.com/qgis/QGIS/actions/runs/12656340998) should be universal and works here on my x64 machine ...

@eflaten
Copy link

eflaten commented Jan 7, 2025

qgis macos Qt6 universal: ( https://github.com/qgis/QGIS/actions/runs/12656340998/artifacts/2397658648)
in: (https://github.com/qgis/QGIS/actions/runs/12656340998)
started from terminal.
Hurra!

`

QGIS version 3.41.0-Master
QGIS code revision d465ca2
 
Libraries
Qt version 6.8.1
Python version 3.11.10
GDAL/OGR version 3.9.3
PROJ version 9.5.1
EPSG Registry database version v11.022 (2024-11-05)
GEOS version 3.13.0-CAPI-1.19.0
SQLite version 3.47.2
PDAL version 2.8.1
PostgreSQL client version unknown
SpatiaLite version 5.1.0
QWT version 6.3.0
QScintilla2 version 2.14.1
OS version macOS Sequoia (15.2)
 
Active Python plugins
processing 2.12.99
grassprovider 2.12.99
db_manager 0.1.20
MetaSearch 0.3.6

@NyakudyaA
Copy link
Contributor

Also could start the app using the dmg
Screenshot 2025-01-08 at 09 42 47

However, starting QGIS from the terminal I get a bunch of errors i.e
Screenshot 2025-01-08 at 09 44 25

Screenshot 2025-01-08 at 09 45 02 Screenshot 2025-01-08 at 09 45 48 Screenshot 2025-01-08 at 09 46 21

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 8, 2025

@NyakudyaA that's great news, thanks !
Is it possible that when starting from the console there are conflicting environment variables around (e.g. for python)?

@m-kuhn m-kuhn marked this pull request as ready for review January 8, 2025 10:35
@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 8, 2025

The problems with x64 are "fixed".
Here's what we do now:

  • we create .app's in the matrix run (one for x64 and one for arm64)
  • upload these as assets
  • merge the two apps and their libraries into a universal FAT .app (which runs natively on both architectures)
  • bundle this into a dmg on an arm64 runner (where hdiutil runs stable)

Best of all worlds 🎉

Gdal algorithms are fixed as well now.

@e-kotov
Copy link

e-kotov commented Jan 8, 2025

Tested arm64 on M1 with latest Sonoma. Started the app, opened a simple project. Seems to be working well.

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 9, 2025

@gy-mate new background image inbound (again)

@oskarlin
Copy link

oskarlin commented Jan 9, 2025

@eflaten if you happen to have an arm64 (M series) machine, a test of https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714 would be appreciated.

I tried this but get this error message:

“QGIS-PR60039.app” is damaged and can’t be opened. You should move it to the Bin.

The Universal version worked.

I'm using a Mac mini with M2 Pro and Mac OS 15.2

@gy-mate
Copy link

gy-mate commented Jan 9, 2025

@oskarlin Have you tried opening it like this: #60039 (comment)?

@tsmcgrath
Copy link

Hello @m-kuhn,
I do want to thank you for all the hard work on these releases. I know the community really appreciates. So, Vielen Dank.

With the latest build I've had problems with previous builds not running. 3.40.1 no longer even starts up, freezing on the launch screen. Removing the latest app did not help. Feels like problem is in one of the dependency libraries or a plug-in?

Also, both 3.40.1 and the latest build crash with this code snippet. I haven't narrowed it down to which line is crashing the app yet. Given I cannot run 3.40.1 it may take a bit to narrow the repro case:

# Get the root of the layer tree
root = QgsProject.instance().layerTreeRoot()

# Replace 'GeoCatch_v1-0' with the name of your layer
layer_name = 'GeoCatch_v1-0'  # Replace with your layer name
layer_tree_layer = root.findLayer(QgsProject.instance().mapLayersByName(layer_name)[0].id())
legend_model = QgsLayerTreeModel(root)
# Iterate over the legend items for the layer
for index in range(legend_model.rowCount()):
    item = legend_model.index(index, 0).internalPointer()
    item.printLegend()

@tsmcgrath
Copy link

tsmcgrath commented Jan 9, 2025

Re-installed 3.40.2 and previously tested python scripts from the console are working. I'll try re-installing QGIS-PR60039.

@tsmcgrath
Copy link

https://github.com/qgis/QGIS/actions/runs/12642053020/artifacts/2393456714

I'm getting the same error as @oskarlin trying to install QGIS-PR60039 on a Mac Pro M1 with Sequoia 15.1.1

@oskarlin
Copy link

oskarlin commented Jan 9, 2025

@gy-mate yes, this option is not possible because of the "corrupt" files.

@tsmcgrath
Copy link

Crashing issue noted in the regular QGIS Issues as a comment in a similar ticket.
#60025 (comment)

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 9, 2025

Did you try the version frome here : #60039 (comment)
(Sorry for the older links floating around in here)

@oskarlin
Copy link

oskarlin commented Jan 9, 2025

@m-kuhn I tried it yesterday but it didn't start at all. Now I downloaded it again and it works. But I guess it's not Silicon-built?

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 9, 2025

@m-kuhn I tried it yesterday but it didn't start at all. Now I downloaded it again and it works. But I guess it's not Silicon-built?

It is
To check you can run the following command after installation

file /Applications/QGIS-PR60039.app/Contents/MacOS/QGIS-PR60039

It will print the supported architectures

@fdenzinger
Copy link

Did you try the version frome here : #60039 (comment) (Sorry for the older links floating around in here)

Can confirm that this version works on a M1 MacBook Pro running macOS Sequoia 15.2 🚀

Co-authored-by: Nicolas Godet <[email protected]>
@beginor
Copy link

beginor commented Jan 10, 2025

Did you try the version frome here : #60039 (comment) (Sorry for the older links floating around in here)

Confirm, This version works on MacBook Pro M1 Max running macOS Sequoia 15.2 🚀

@oskarlin
Copy link

@m-kuhn I tried it yesterday but it didn't start at all. Now I downloaded it again and it works. But I guess it's not Silicon-built?

It is To check you can run the following command after installation

file /Applications/QGIS-PR60039.app/Contents/MacOS/QGIS-PR60039

It will print the supported architectures

OK, so Universal mean it is not Rosetta mode, instead it includes builds for both architectures?

@oskarlin
Copy link

Did you try the version frome here : #60039 (comment) (Sorry for the older links floating around in here)

It works now. Only problem i've seen now is that some of the menu commands doesn't have any keyboard shortcuts to it, or maybe it has but it renders errors in the menu, see attached image.

Screenshot 2025-01-10 at 12 34 28

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 10, 2025

@m-kuhn I tried it yesterday but it didn't start at all. Now I downloaded it again and it works. But I guess it's not Silicon-built?

It is To check you can run the following command after installation

file /Applications/QGIS-PR60039.app/Contents/MacOS/QGIS-PR60039

It will print the supported architectures

OK, so Universal mean it is not Rosetta mode, instead it includes builds for both architectures?

This is correct, mac users will not need to choose what to download / know what CPU they run. It will run natively on x64 (Intel) AND arm64 (M series)

@nicogodet
Copy link
Member

Did you try the version frome here : #60039 (comment) (Sorry for the older links floating around in here)

It works now. Only problem i've seen now is that some of the menu commands doesn't have any keyboard shortcuts to it, or maybe it has but it renders errors in the menu, see attached image.
Screenshot 2025-01-10 at 12 34 28

As this is out of scope of this PR, could you open another issue ?

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 10, 2025

@3nids as per your latest request on a different channel, PyQt6.QtQuickWidgets import should be fixed now

@DelazJ
Copy link
Contributor

DelazJ commented Jan 11, 2025

Does this build open ECW and other proprietary file formats the current qt5 .dmg allows to open (upon license agreement)?

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 11, 2025

Does this build open ECW and other proprietary file formats the current qt5 .dmg allows to open (upon license agreement)?

This is built on a completely new dependency stack. It's unlikely that this is supported at the moment.

@tsmcgrath
Copy link

@m-kuhn The build from:
#60039 (comment)

opens and seems to run fine for me on a Mac M1, Sequoia 15.2

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 11, 2025

@DelazJ do you have any especially preferred driver in the proprietary formats?

@kommen
Copy link

kommen commented Jan 11, 2025

@m-kuhn: thanks a lot for working on this! Testing the build #60039 (comment) seems to work nicely in general on macOS Sonoma 14.7.2 (M2 MacBook Pro)

Trying to get some of the plugins working, I ran into #60119

@DelazJ
Copy link
Contributor

DelazJ commented Jan 11, 2025

@m-kuhn afaict, the one i'm conscious I use/need is the ECW one. I'm sorry I can't list what else is provided in the package.

@m-kuhn
Copy link
Member Author

m-kuhn commented Jan 11, 2025

There's also mrsid and oracle as far as I can see

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

Successfully merging this pull request may close these issues.

Native support for Apple Silicon (ARM64 architecture)