[qtbase] fix windeployqt webengine deployment for debug builds (#52702)

Co-authored-by: Billy O'Neal <bion@microsoft.com>
This commit is contained in:
Nick D'Ademo 2026-07-05 18:36:43 +08:00 committed by GitHub
parent 09c52f8484
commit 2db624347f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 49 additions and 3 deletions

View File

@ -21,6 +21,7 @@ set(${PORT}_PATCHES
clang-cl_QGADGET_fix.diff
fix-host-aliasing.patch
fix_deploy_windows.patch
windeployqt-webengine-debug-resources.patch
fix-link-lib-discovery.patch
macdeployqt-symlinks.patch
moltenvk.patch
@ -497,6 +498,7 @@ endif()
set(_file "${CMAKE_CURRENT_LIST_DIR}/qt.conf.in")
set(REL_PATH "")
set(REL_HOST_TO_DATA "\${CURRENT_INSTALLED_DIR}/")
set(LIBEXEC_DEBUG_SUFFIX "")
configure_file("${_file}" "${CURRENT_PACKAGES_DIR}/tools/Qt6/qt_release.conf" @ONLY) # For vcpkg-qmake
set(BACKUP_CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}")
set(BACKUP_CURRENT_HOST_INSTALLED_DIR "${CURRENT_HOST_INSTALLED_DIR}")
@ -507,6 +509,9 @@ set(CURRENT_HOST_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}${installed_to_host}")
set(REL_HOST_TO_DATA "${host_to_installed}")
configure_file("${_file}" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qt.conf")
set(REL_PATH debug/)
if(VCPKG_TARGET_IS_WINDOWS)
set(LIBEXEC_DEBUG_SUFFIX "/debug")
endif()
configure_file("${_file}" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qt.debug.conf")
set(CURRENT_INSTALLED_DIR "${BACKUP_CURRENT_INSTALLED_DIR}")

View File

@ -6,7 +6,7 @@ Plugins=@REL_PATH@@QT6_DIRECTORY_PREFIX@plugins
Qml2Imports=@REL_PATH@@QT6_DIRECTORY_PREFIX@qml
Documentation=doc/@QT6_DIRECTORY_PREFIX@
Binaries=@REL_PATH@bin
LibraryExecutables=tools/Qt6/bin
LibraryExecutables=tools/Qt6/bin@LIBEXEC_DEBUG_SUFFIX@
ArchData=share/Qt6
Data=share/Qt6
Translations=translations/@QT6_DIRECTORY_PREFIX@
@ -19,7 +19,7 @@ Plugins=@REL_PATH@@QT6_DIRECTORY_PREFIX@plugins
Qml2Imports=@REL_PATH@@QT6_DIRECTORY_PREFIX@qml
Documentation=doc/@QT6_DIRECTORY_PREFIX@
Binaries=@REL_PATH@bin
LibraryExecutables=tools/Qt6/bin
LibraryExecutables=tools/Qt6/bin@LIBEXEC_DEBUG_SUFFIX@
ArchData=share/Qt6
Data=share/Qt6
Translations=translations/@QT6_DIRECTORY_PREFIX@

View File

@ -1,6 +1,7 @@
{
"name": "qtbase",
"version": "6.11.1",
"port-version": 1,
"description": "Qt Base (Core, Gui, Widgets, Network, ...)",
"homepage": "https://www.qt.io/",
"license": null,

View File

@ -0,0 +1,35 @@
Locate the debug Qt WebEngine resources under the vcpkg debug tree.
In the vcpkg layout the qtwebengine port moves the release WebEngine resources
into share/Qt6/resources (== QT_INSTALL_DATA/resources), but keeps the debug
".debug.pak" resources under <prefix>/debug/resources. QT_INSTALL_DATA is shared
between the debug and release configurations, so windeployqt looked for the debug
resources in share/Qt6/resources and failed with e.g.
"...\share\Qt6\resources\qtwebengine_resources.debug.pak does not exist."
Resolve the resources from QT_INSTALL_PREFIX/debug for a debug deployment; the
release path is unchanged. Paired with the LibraryExecutables fix in qt.conf.in
(which points QT_INSTALL_LIBEXECS at tools/Qt6/bin/debug for the debug config),
this lets windeployqt deploy Qt WebEngine for debug builds without relocating any
debug binaries into the non-debug tree.
diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp
index 839a0b4..bd0590e 100644
--- a/src/tools/windeployqt/main.cpp
+++ b/src/tools/windeployqt/main.cpp
@@ -1955,8 +1955,13 @@ static bool deployWebEngineCore(const QMap<QString, QString> &qtpathsVariables,
if (!deployWebProcess(qtpathsVariables, webEngineProcessName, pluginInfo, options, errorMessage))
return false;
const QString resourcesSubDir = QStringLiteral("/resources");
- const QString resourcesSourceDir = qtpathsVariables.value(QStringLiteral("QT_INSTALL_DATA"))
- + resourcesSubDir + u'/';
+ // vcpkg keeps the debug Qt WebEngine resources (.debug.pak) under <prefix>/debug/resources,
+ // separate from the release resources in QT_INSTALL_DATA/resources. QT_INSTALL_DATA is shared
+ // between debug and release, so resolve the debug resources from the prefix instead.
+ const QString resourcesBaseDir = isDebug
+ ? qtpathsVariables.value(QStringLiteral("QT_INSTALL_PREFIX")) + QStringLiteral("/debug")
+ : qtpathsVariables.value(QStringLiteral("QT_INSTALL_DATA"));
+ const QString resourcesSourceDir = resourcesBaseDir + resourcesSubDir + u'/';
const QString resourcesTargetDir(options.directory + resourcesSubDir);
if (!createDirectory(resourcesTargetDir, errorMessage, options.dryRun))
return false;

View File

@ -8410,7 +8410,7 @@
},
"qtbase": {
"baseline": "6.11.1",
"port-version": 0
"port-version": 1
},
"qtcharts": {
"baseline": "6.11.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d5dcf61ca1fc4fb94a69b3b7fadff76587ecd0d5",
"version": "6.11.1",
"port-version": 1
},
{
"git-tree": "29a7f9f115d568b271a3b99fabeac886ec248f9f",
"version": "6.11.1",