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

Qt5 various fixes #24009

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions recipes/qt/5.x.x/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,21 @@
- "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/5.15/5.15.9/single/qt-everywhere-opensource-src-5.15.9.tar.xz"
sha256: "26d5f36134db03abe4a6db794c7570d729c92a3fc1b0bf9b1c8f86d0573cd02f"
patches:
"5.15.13":
- "base_path": "qt5/qtbase"
"patch_file": "patches/aa2a39dea5.diff"

Check warning on line 99 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtbase ^ (line: 98)
- "base_path": "qt5/qtwebengine"
"patch_file": "patches/c72097e.diff"

Check warning on line 101 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtwebengine ^ (line: 100)
- "base_path": "qt5/qttools"
"patch_file": "patches/fix-macdeployqt.diff"

Check warning on line 103 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qttools ^ (line: 102)
- "base_path": "qt5/qtwebengine/src/3rdparty"
"patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch"

Check warning on line 105 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtwebengine/s ... ^ (line: 104)
- "base_path": "qt5/qtwebengine/src/3rdparty"
"patch_file": "patches/Fix-errors-and-warnings-for-perfetto.patch"

Check warning on line 107 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtwebengine/s ... ^ (line: 106)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- "base_path": "qt5/qtbase"
"patch_file": "patches/android-backtrace.diff"

Check warning on line 109 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtbase ^ (line: 108)
- "base_path": "qt5/qtbase"
"patch_file": "patches/android-openssl.diff"

Check warning on line 111 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtbase ^ (line: 110)
- "base_path": "qt5/qtbase"
"patch_description": "Fix qmake build with apple-clang>=15"
"patch_file": "patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch"
Expand All @@ -118,13 +120,13 @@
"patch_source": "https://codereview.qt-project.org/c/qt/qtbase/+/482392"
"patch_type": "portability"
"5.15.12":
- "base_path": "qt5/qtbase"
"patch_file": "patches/aa2a39dea5.diff"
- "base_path": "qt5/qtwebengine"

Check warning on line 125 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtbase ^ (line: 124)
"patch_file": "patches/c72097e.diff"
- "base_path": "qt5/qttools"

Check warning on line 127 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qtwebengine ^ (line: 126)
"patch_file": "patches/fix-macdeployqt.diff"
- "base_path": "qt5/qtwebengine/src/3rdparty/chromium/v8"

Check warning on line 129 in recipes/qt/5.x.x/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - base_path: qt5/qttools ^ (line: 128)
"patch_file": "patches/chromium-v8-missing-constexpr.patch"
- "base_path": "qt5/qtwebengine/src/3rdparty"
"patch_file": "patches/chromium-skia-missing-iterator-include.patch"
Expand Down
27 changes: 22 additions & 5 deletions recipes/qt/5.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"with_libjpeg": ["libjpeg", "libjpeg-turbo", False],
"with_libpng": [True, False],
"with_sqlite3": [True, False],
"with_mysql": [True, False],
"with_mysql": ["mysql", "mariadb", False],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support both mysql and mariadb as sql backend

"with_pq": [True, False],
"with_odbc": [True, False],
"with_libalsa": [True, False],
Expand Down Expand Up @@ -99,7 +99,7 @@
"with_libjpeg": "libjpeg",
"with_libpng": True,
"with_sqlite3": True,
"with_mysql": True,
"with_mysql": "mysql",
"with_pq": True,
"with_odbc": True,
"with_libalsa": False,
Expand Down Expand Up @@ -192,7 +192,6 @@
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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysql also supported on windows! not sure why it was forced to force before

del self.options.with_gssapi
if self.settings.os != "Linux":
Expand Down Expand Up @@ -384,8 +383,10 @@
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:
Expand Down Expand Up @@ -727,6 +728,7 @@
("libjpeg-turbo", "LIBJPEG"),
("libpng", "LIBPNG"),
("sqlite3", "SQLITE"),
("mariadb-connector-c", "MYSQL"),
("libmysqlclient", "MYSQL"),
("libpq", "PSQL"),
("odbc", "ODBC"),
Expand Down Expand Up @@ -754,6 +756,8 @@

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":
Expand Down Expand Up @@ -946,7 +950,7 @@
filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n'
save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents)

def _create_private_module(module, dependencies=[]):

Check warning on line 953 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
if "Core" not in dependencies:
dependencies.append("Core")
dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies)
Expand Down Expand Up @@ -978,6 +982,12 @@
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")
Expand Down Expand Up @@ -1015,7 +1025,7 @@
reqs.append(corrected_req)
return reqs

def _create_module(module, requires=[], has_include_dir=True):

Check warning on line 1028 in recipes/qt/5.x.x/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Dangerous default value [] as argument
componentname = f"qt{module}"
assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components"
self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}")
Expand Down Expand Up @@ -1074,6 +1084,9 @@
]
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}"
Expand Down Expand Up @@ -1216,8 +1229,10 @@
_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"])
Expand Down Expand Up @@ -1246,6 +1261,7 @@
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"])
Expand Down Expand Up @@ -1334,6 +1350,7 @@

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")
Expand Down
101 changes: 101 additions & 0 deletions recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
From 851cd7c7a079fa5da63770c49724036e8338e813 Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
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 <negyokru@inf.u-szeged.hu>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
.../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<CircularQueue<T>::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

Loading