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 Builds #59177

Merged
merged 14 commits into from
Oct 30, 2024
Merged

Mac Qt6 Builds #59177

merged 14 commits into from
Oct 30, 2024

Conversation

m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented Oct 23, 2024

Work in progress

Build instructions

# install xcode command line tools --> check internet
# maybe needs an xcode-select or so too ?

# install vcpkg
. <(curl https://aka.ms/vcpkg-init.sh -L)
# install build requirements (install homebrew first if not yet done)
brew install git cmake flex bison automake autoconf libtool nasm ninja
# get code
git clone [email protected]:qgis/QGIS.git

# prepare env
export PATH=$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix libtool)/bin:$PATH

# select your architecture here
TRIPLET=arm64-osx-dynamic-release
# TRIPLET=x64-osx-dynamic-release

cmake -S . \
      -G Ninja \
      -B build \
      -D WITH_VCPKG=ON \
      -D BUILD_WITH_QT6=ON \
      -D WITH_QTWEBKIT=OFF \
      -D WITH_BINDINGS=ON \
      -D QGIS_MACAPP_FRAMEWORK=OFF \
      -D VCPKG_TARGET_TRIPLET="$TRIPLET" \
      -D VCPKG_HOST_TRIPLET="$TRIPLET" \
      -D CREATE_MACOSX_BUNDLE=OFF

# build (use RelWithDebInfo if you want to debug)
cmake --build build --target Release

@github-actions github-actions bot added this to the 3.40.0 milestone Oct 23, 2024
Copy link

github-actions bot commented Oct 23, 2024

🪟 Windows builds

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

🪟 Windows Qt6 builds

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

🧮 Vcpkg update report

@m-kuhn
Copy link
Member Author

m-kuhn commented Oct 23, 2024

Added a little quality of life improvement where this will report on library updates

@nyalldawson
Copy link
Collaborator

Should we drop the existing Mac workflow now? I can't see many benefits of retaining it since it's a build-only test, and this should nicely cover that. (Plus it'd release the road block preventing us upgrading the minimum python version).

@m-kuhn
Copy link
Member Author

m-kuhn commented Oct 24, 2024

There are two things this doesn't currently cover:

  • packaging / dmg
  • qt5

A few other things in the category nice to have:

  • grass
  • saga
  • other additional deps ?

@nyalldawson
Copy link
Collaborator

@m-kuhn

There are two things this doesn't currently cover:

packaging / dmg

Unless I'm mistaken the current Mac build doesn't include these either, right?

qt5

Valid point, but I don't think a qt5 build without tests or usable artifacts is very useful.

Saga

That's all been dropped from processing, there's no need to spend effort on packaging this. If someone wants Saga functionality they can use official saga Mac install process + the community saga plugin.

@m-kuhn
Copy link
Member Author

m-kuhn commented Oct 24, 2024

If we don't ship the product here for end users (qt5 and dmg) the python problem still persists, no?

Saga

That's all been dropped from processing, there's no need to spend effort on packaging this. If someone wants Saga functionality they can use official saga Mac install process + the community saga plugin

👍

@nyalldawson
Copy link
Collaborator

If we don't ship the product here for end users (qt5 and dmg) the python problem still persists, no?

Could the approach used here be easily adapted to also make a qt5 build?

@m-kuhn
Copy link
Member Author

m-kuhn commented Oct 24, 2024

Yes, we've had success with that for kadas

@3nids
Copy link
Member

3nids commented Oct 30, 2024

If I'm not wrong the workflow is missing some build cache.
What would be the approach here? We merge this without the workflow part? or make it on demand?

@3nids
Copy link
Member

3nids commented Oct 30, 2024

Also many thanks @m-kuhn for making compilation of QGIS so straightforward on macOS!!!

@m-kuhn
Copy link
Member Author

m-kuhn commented Oct 30, 2024

I think we'll need to disable/tune other workflows before we can afford more build cache otherwise we'll overuse the cache. That was one of the reasons to mark it as "draft"
If this has benefit already without workflow (for mac devs) we can merge with the workflow disabled and start a new draft PR, your call @3nids

@3nids 3nids marked this pull request as ready for review October 30, 2024 07:16
@3nids
Copy link
Member

3nids commented Oct 30, 2024

let's merge it!

@3nids 3nids merged commit b167311 into qgis:master Oct 30, 2024
30 checks passed
@qgis-bot
Copy link
Collaborator

The backport to release-3_40 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'

stdout
[backport-59177-to-release-3_40 e4ec051ce91] Fix setup-vcpkg for non windows
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 9 09:01:12 2024 +0200
 3 files changed, 122 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/build-macos-qt6.yml
 create mode 100644 vcpkg/triplets/arm64-osx-dynamic-release.cmake
[backport-59177-to-release-3_40 69f049499fa] osx rpath patch
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 9 14:30:39 2024 +0200
 1 file changed, 2 insertions(+)
[backport-59177-to-release-3_40 328a1f1f457] binary caching for non windows
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 9 13:20:36 2024 +0200
 1 file changed, 13 insertions(+), 4 deletions(-)
[backport-59177-to-release-3_40 5704c342a40] registry
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 9 10:56:41 2024 +0200
 1 file changed, 2 insertions(+), 1 deletion(-)
[backport-59177-to-release-3_40 ab4a9f87a81] logs
 Author: Matthias Kuhn <[email protected]>
 Date: Fri Oct 11 16:51:30 2024 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
[backport-59177-to-release-3_40 fb53e86a71a] Add x64-osx-dynamic-release
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 23 12:14:36 2024 +0200
 1 file changed, 11 insertions(+)
 create mode 100644 vcpkg/triplets/x64-osx-dynamic-release.cmake
[backport-59177-to-release-3_40 faf39203589] upstream
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 23 13:35:00 2024 +0200
 1 file changed, 2 deletions(-)
[backport-59177-to-release-3_40 da5d95038ef] Make it possible to create dev builds for mac
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 23 14:13:47 2024 +0200
 1 file changed, 7 insertions(+), 1 deletion(-)
[backport-59177-to-release-3_40 ce1fb02c720] Bump cmake / disable framework
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 23 14:14:05 2024 +0200
 1 file changed, 3 insertions(+), 2 deletions(-)
[backport-59177-to-release-3_40 209b6790826] Pin setuptools to avoid missing  for gdal
 Author: Matthias Kuhn <[email protected]>
 Date: Wed Oct 23 16:21:25 2024 +0200
 3 files changed, 95 insertions(+)
 create mode 100644 vcpkg/ports/py-setuptools/fix-prefix.patch
 create mode 100644 vcpkg/ports/py-setuptools/portfile.cmake
 create mode 100644 vcpkg/ports/py-setuptools/vcpkg.json
On branch backport-59177-to-release-3_40
You are currently cherry-picking commit d1e63f61aab.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_40 release-3_40
# Navigate to the new working tree
cd .worktrees/backport-release-3_40
# Create a new branch
git switch --create backport-59177-to-release-3_40
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 51a21bd99a24da8dff16504ee02ccfef7cac7e9d,529ac6f7ce88f12337d1e272baa3a9084e3d32fe,ed08e3983b45a8a872bdbcce51d4866903e665de,443d09cda3a2e5746d0b00bee0008321e9acbf93,d9e68a1b852815261cc7a12ef0dfb1c34bae89d7,765e02bd68e14aaca04016acd832053029f2252b,9dd08475333ee3d7fa8b7c23f248c956a36c8c4c,9339143a0af92e4a7f08c9dd6149d5ed12d637c7,2f7dc21d842e5db548855158b7e98df281b12e3c,e7b9f5ca2bad4d0c653f1fd4ab0be66187cfa7f6,d1e63f61aab92283b779eaeb4ac982d9f4a81784,d1e0bb6f817acbdeae3c490c7f63d3de16b9a05a,d277e8420fae5fbd616a2e37162e9786011917e9,bc745957bf316f29e5c063146bc66444c6064838
# Push it to GitHub
git push --set-upstream origin backport-59177-to-release-3_40
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_40

Then, create a pull request where the base branch is release-3_40 and the compare/head branch is backport-59177-to-release-3_40.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Oct 30, 2024
@m-kuhn m-kuhn deleted the macvcpkg branch October 30, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3_40 failed backport The automated backport attempt failed, needs a manual backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants