Skip to content

Add -DWITH_BUILD_QT CMake option and --build-qt release-tool flags - #13473

Open
phoerious wants to merge 1 commit into
developfrom
feature/qt-feature
Open

Add -DWITH_BUILD_QT CMake option and --build-qt release-tool flags#13473
phoerious wants to merge 1 commit into
developfrom
feature/qt-feature

Conversation

@phoerious

@phoerious phoerious commented Jun 28, 2026

Copy link
Copy Markdown
Member

Add a -DWITH_BUILD_QT CMake option and --build-qt release-tool flags to build Qt6 via vcpkg instead of using binaries from the system.

Fixes the problem that preinstalled Qt binaries can have a different MACOSX_DEPLOYMENT_TARGET set and other issues that make them unsuitable for redistribution.

Testing strategy

Built on macOS with ./release-tool.py build --snapshot 2.8.0 --sign --build-qt.

Type of change

  • ✅ New feature (change that adds functionality)

@phoerious phoerious added this to the v2.8.0 milestone Jun 28, 2026
@phoerious
phoerious requested review from a team and droidmonkey June 28, 2026 13:28
@phoerious
phoerious force-pushed the feature/qt-feature branch from 50effaa to 8d3592b Compare June 28, 2026 13:32
@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.12%. Comparing base (ce28e2a) to head (fabfba2).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #13473   +/-   ##
========================================
  Coverage    63.12%   63.12%           
========================================
  Files          385      385           
  Lines        40932    40932           
========================================
+ Hits         25836    25837    +1     
+ Misses       15096    15095    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@phoerious
phoerious marked this pull request as draft June 28, 2026 16:08
@phoerious
phoerious force-pushed the feature/qt-feature branch from 8d3592b to b32c2a4 Compare June 28, 2026 16:23
@phoerious

phoerious commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

Problem: macdeployqt is installed in the host prefix, but it needs to find Qt in the target prefix, which at the moment it doesn't. Need to find a solution before this can be merged.

@phoerious
phoerious force-pushed the feature/qt-feature branch 2 times, most recently from 9b36a11 to d15bfff Compare June 28, 2026 21:36
@phoerious

phoerious commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

I think I fixed it. The initial issue was that CMake's RPATH resolution wasn't set correctly. This prevented macdeployqt from finding any of the vcpkg dependencies (not only, but also when Qt was installed externally). I fixed that by adding it to CMAKE_INSTALL_RPATH explicitly.

However, that still did't allow macdeployqt to find the Qt plugins. The underlying issue is that vcpkg installs macdeployqt only to the host triplet install dir. Previously, with qt5, it was installed to the target triplet install dir as well, so this issue didn't show up. Now, it either cannot find macdeployqt or, when I point it to the correct location, it cannot find the Qt libraries and plugins. I would consider this a vcpkg bug, because it kind of makes cross compilation impossible or very hard at least.

My fix for now is to simply symlink macdeployqt or windeployqt from the host install dir to the target install dir and start it from there. A qt_release.conf or qt_debug.conf exists there already. This is not pretty, but it seems to work. A cleaner but also much more involved fix would be to copy it somewhere to the cmake binary dir and create a custom qt.conf next to it.

@droidmonkey Can you test whether this also works on Windows?

The next milestone is to wait for this to get fixed: microsoft/vcpkg#52624

@phoerious
phoerious marked this pull request as ready for review June 28, 2026 21:44
@phoerious
phoerious force-pushed the feature/qt-feature branch from d15bfff to 07548ab Compare June 28, 2026 21:46
@droidmonkey

Copy link
Copy Markdown
Member

Actually not ready, getting this error when running the release tool:

python .\release-tool.py build 2.8.0 --snapshot -y --build-qt

-- Running vcpkg install
error: qtbase@6.10.0#1 does not have required feature windeployqt needed by keepassxc

@droidmonkey

Copy link
Copy Markdown
Member

Removing the feature makes it work, windeployqt is built and installed in the tools directory as expected:

image

@droidmonkey

Copy link
Copy Markdown
Member

However you still try to create a symbolic link to macdeployqt on windows...

CMake Error at CMakeLists.txt:475 (file):
  file failed to create symbolic link
  'C:/Users/xxxx/AppData/Local/Temp/tmp2tuzahyh/vcpkg_installed/x64-windows/tools/Qt6/bin/macdeployqt':
  A required privilege is not held by the client.

@droidmonkey
droidmonkey self-requested a review June 29, 2026 03:46
@phoerious

phoerious commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Oops, true. However, the issue might not be the missing that but that you need admin permissions for symlinks on Windows. Totally forgot about that. Maybe copying the file is better.

@phoerious

Copy link
Copy Markdown
Member Author

@droidmonkey Try again. I had to advance the baseline, so you probably need to update the Windows and macOS CI.

… build Qt6 via vcpkg instead of using binaries from the system

Also advance vcpkg baseline to pull in Qt 6.11 and to fix compilation
with macOS SDK 26.
@phoerious
phoerious force-pushed the feature/qt-feature branch from 916bf77 to fabfba2 Compare July 2, 2026 20:37
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.

2 participants