From 68f3d5737dff2d508c0e2d99c863ad781c0ec815 Mon Sep 17 00:00:00 2001 From: Walid Boussafa Date: Thu, 16 May 2024 14:21:12 +0100 Subject: [PATCH 1/4] patch for QTBUG-117073 QtWebEngine build error for msvc 2022 --- recipes/qt/5.x.x/conandata.yml | 2 + ...Fix-errors-and-warnings-for-perfetto.patch | 101 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml index a8c2e2c8e2a71..5ba80e0256e8e 100644 --- a/recipes/qt/5.x.x/conandata.yml +++ b/recipes/qt/5.x.x/conandata.yml @@ -103,6 +103,8 @@ patches: "patch_file": "patches/fix-macdeployqt.diff" - "base_path": "qt5/qtwebengine/src/3rdparty" "patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/Fix-errors-and-warnings-for-perfetto.patch" - "base_path": "qt5/qtbase" "patch_file": "patches/android-backtrace.diff" - "base_path": "qt5/qtbase" diff --git a/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch new file mode 100644 index 0000000000000..abd82e1674e40 --- /dev/null +++ b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch @@ -0,0 +1,101 @@ +From 851cd7c7a079fa5da63770c49724036e8338e813 Mon Sep 17 00:00:00 2001 +From: Michal Klocek +Date: Wed, 20 Sep 2023 07:45:29 +0200 +Subject: [PATCH] Fix errors and warnings for perfetto +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +It seems newest msvc compiler does not like perfetto circualar queue +const iterator, which ends in issues with std::swap of std::sort. +Make sure it is non const. + +Fix warnings. + +Deals with: "error C2672: 'swap': no matching overloaded function +found." + +Fixes: QTBUG-117073 +Change-Id: I02901e61a1bb8863d72ca02a0ccd841e54309d6e +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/505412 +Reviewed-by: Martin Negyokru +Reviewed-by: Michael Brüning +--- + .../perfetto/include/perfetto/ext/base/circular_queue.h | 9 ++------- + .../third_party/perfetto/src/trace_processor/storage/metadata.h | 2 ++ + .../third_party/perfetto/src/trace_processor/storage/stats.h | 2 ++ + .../perfetto/src/trace_processor/tables/macros_internal.h | 2 ++ + 4 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +index 18ca7702614..ec46e69f817 100644 +--- a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h ++++ b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +@@ -67,19 +67,14 @@ class CircularQueue { + ignore_result(generation); + } + +- T* operator->() { ++ T* operator->() const { + #if PERFETTO_DCHECK_IS_ON() + PERFETTO_DCHECK(generation_ == queue_->generation()); + #endif + return queue_->Get(pos_); + } + +- const T* operator->() const { +- return const_cast::Iterator*>(this)->operator->(); +- } +- +- T& operator*() { return *(operator->()); } +- const T& operator*() const { return *(operator->()); } ++ T& operator*() const { return *(operator->()); } + + value_type& operator[](difference_type i) { return *(*this + i); } + +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +index 4796ae4edcd..30e534b216b 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +@@ -59,8 +59,10 @@ namespace metadata { + F(kMulti, "multi") + // clang-format + ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + // Ignore GCC warning about a missing argument for a variadic macro parameter. + #pragma GCC system_header ++#endif + + #define PERFETTO_TP_META_TYPE_ENUM(varname, ...) varname + enum class KeyType : size_t { +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +index 7f14803244e..30b56c62544 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +@@ -189,7 +189,9 @@ enum Source { + }; + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Declares an enum of literals (one for each stat). The enum values of each + // literal corresponds to the string index in the arrays below. +diff --git a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +index 875efd62e0d..1ca5068cc32 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h ++++ b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +@@ -140,7 +140,9 @@ class MacroTable : public Table { + } // namespace macros_internal + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Basic helper macros. + #define PERFETTO_TP_NOOP(...) +-- +2.16.3 + From b0ee607fc8b0dee71cb2b1fd3849cf2f6ff70a7f Mon Sep 17 00:00:00 2001 From: Walid Boussafa Date: Thu, 16 May 2024 14:22:16 +0100 Subject: [PATCH 2/4] define QT_NO_DEBUG for non Debug build --- recipes/qt/5.x.x/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index f45348ca816a3..532f42f2cd662 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -1074,6 +1074,9 @@ def _create_plugin(pluginname, libname, plugintype, requires): ] self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + if self.settings.build_type != "Debug": + self.cpp_info.components['qtCore'].defines.append('QT_NO_DEBUG') + if self.settings.os == "Windows": module = "WinMain" componentname = f"qt{module}" From 31fce7e95d1b7bb82189b56b9d3491492ee2645e Mon Sep 17 00:00:00 2001 From: Walid Boussafa Date: Thu, 16 May 2024 14:24:33 +0100 Subject: [PATCH 3/4] Add missing private modules for Quick and Scxml --- recipes/qt/5.x.x/conanfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 532f42f2cd662..9c6ea7101a032 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -978,6 +978,12 @@ def _create_private_module(module, dependencies=[]): if self.options.qtdeclarative: _create_private_module("Qml", ["CorePrivate", "Qml"]) + if self.options.gui: + _create_private_module("Quick", ["CorePrivate", "GuiPrivate", "QmlPrivate", "Quick"]) + + if self.options.qtscxml: + _create_private_module("Scxml", ["Scxml", "Qml"]) + def package_info(self): self.cpp_info.set_property("cmake_file_name", "Qt5") self.cpp_info.set_property("pkg_config_name", "qt5") @@ -1249,6 +1255,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) if self.options.gui: _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + _add_build_module("qtQuick", self._cmake_qt5_private_file("Quick")) if self.options.widgets: _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) @@ -1337,6 +1344,7 @@ def _create_plugin(pluginname, libname, plugintype, requires): if self.options.qtscxml: _create_module("Scxml", ["Qml"]) + _add_build_module("qtScxml", self._cmake_qt5_private_file("Scxml")) if self.options.qtpurchasing: _create_module("Purchasing") From a2adf7036cac6c9c3ac98c4bbc9c2c57ae6e5031 Mon Sep 17 00:00:00 2001 From: Walid Boussafa Date: Thu, 16 May 2024 14:38:47 +0100 Subject: [PATCH 4/4] add support to use mariadb-connector-c as backend instead of libmysqlclient --- recipes/qt/5.x.x/conanfile.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py index 9c6ea7101a032..e252b7999f458 100644 --- a/recipes/qt/5.x.x/conanfile.py +++ b/recipes/qt/5.x.x/conanfile.py @@ -55,7 +55,7 @@ class QtConan(ConanFile): "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], "with_libpng": [True, False], "with_sqlite3": [True, False], - "with_mysql": [True, False], + "with_mysql": ["mysql", "mariadb", False], "with_pq": [True, False], "with_odbc": [True, False], "with_libalsa": [True, False], @@ -99,7 +99,7 @@ class QtConan(ConanFile): "with_libjpeg": "libjpeg", "with_libpng": True, "with_sqlite3": True, - "with_mysql": True, + "with_mysql": "mysql", "with_pq": True, "with_odbc": True, "with_libalsa": False, @@ -192,7 +192,6 @@ def config_options(self): if self.settings.compiler in ["gcc", "clang"] and Version(self.settings.compiler.version) < "5.3": del self.options.with_mysql if self.settings.os == "Windows": - self.options.with_mysql = False self.options.opengl = "dynamic" del self.options.with_gssapi if self.settings.os != "Linux": @@ -384,8 +383,10 @@ def requirements(self): self.requires("libpng/1.6.42") if self.options.with_sqlite3 and not self.options.multiconfiguration: self.requires("sqlite3/3.45.0") - if self.options.get_safe("with_mysql", False): + if self.options.get_safe("with_mysql", False) == "mysql": self.requires("libmysqlclient/8.1.0") + if self.options.get_safe("with_mysql", False) == "mariadb": + self.requires("mariadb-connector-c/3.3.3") if self.options.with_pq: self.requires("libpq/15.4") if self.options.with_odbc: @@ -727,6 +728,7 @@ def build(self): ("libjpeg-turbo", "LIBJPEG"), ("libpng", "LIBPNG"), ("sqlite3", "SQLITE"), + ("mariadb-connector-c", "MYSQL"), ("libmysqlclient", "MYSQL"), ("libpq", "PSQL"), ("odbc", "ODBC"), @@ -754,6 +756,8 @@ def build(self): if "libmysqlclient" in [d.ref.name for d in self.dependencies.direct_host.values()]: args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["libmysqlclient"].package_folder, "bin", "mysql_config")) + if "mariadb-connector-c" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["mariadb-connector-c"].package_folder, "bin", "mysql_config")) if "libpq" in [d.ref.name for d in self.dependencies.direct_host.values()]: args.append("-psql_config \"%s\"" % os.path.join(self.dependencies["libpq"].package_folder, "bin", "pg_config")) if self.settings.os == "Macos": @@ -1225,8 +1229,10 @@ def _create_plugin(pluginname, libname, plugintype, requires): _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) if self.options.with_pq: _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) - if self.options.get_safe("with_mysql", False): + if self.options.get_safe("with_mysql", False) == "mysql": _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["libmysqlclient::libmysqlclient"]) + if self.options.get_safe("with_mysql", False) == "mariadb": + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["mariadb-connector-c::mariadb-connector-c"]) if self.options.with_odbc: if self.settings.os != "Windows": _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"])