KDAB / GammaRay

GammaRay is a tool to poke around in a Qt-application and also to manipulate the application to some extent.
https://www.kdab.com/gammaray
Other
1.61k stars 283 forks source link

Build fails with Qt 6.2.6 #784

Closed spektorius closed 1 year ago

spektorius commented 1 year ago

Build Environment: Windows 10 Qt 6.2.6 mingw_64 GammaRay commit 29dc94264

Here is my build command (by Clion) and log: ``` "C:\Program Files\JetBrains\CLion\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion/bin/ninja/win/x64/ninja.exe" -DGAMMARAY_QT6_BUILD=ON -DCMAKE_INSTALL_PREFIX=D:/src/projects/GammaRay/deploy -G Ninja -S D:\src\projects\GammaRay -B D:\src\projects\GammaRay\cmake-build-release-mingw -- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) -- Could NOT find libbfd (missing: LIBDL_LIBRARY LIBDL_INCLUDE_DIR) -- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR) -- Building GammaRay 2.99.50 (revision: 29dc94264) in Release mode -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) -- Building probe for ABI: qt6_2-GNU-x86_64 (Release) -- Could NOT find Wayland_Server (missing: Wayland_Server_LIBRARY Wayland_Server_INCLUDE_DIR) (found version "") -- Could NOT find Wayland (missing: Wayland_LIBRARIES Server) (Required is at least version "1.12") CMake Warning at cmake/ECM/find-modules/FindWayland.cmake:130 (message): Could not find wayland.xml in Call Stack (most recent call first): plugins/wlcompositorinspector/CMakeLists.txt:11 (find_package) -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org -- qcollectiongenerator not found, documentation collection will not be generated. -- The following features have been enabled: * Option GAMMARAY_BUILD_UI, Build the GammaRay client and in-process UI. * Option GAMMARAY_MULTI_BUILD, Build multiple applicable probe configurations. * Option GAMMARAY_BUILD_CLI_INJECTOR, Build command line injector on Windows. * Option GAMMARAY_BUILD_DOCS, Build GammaRay documentation. * Option GAMMARAY_QT6_BUILD, Build with Qt6. * Widget .ui file export, Requires QtDesigner library. * User Manual creation in qch format, Requires qdoc, qhelpgenerator, qtattributionsscanner, the qdoc templates and index files -- The following OPTIONAL packages have been found: * Git Determine exact build version. * Qt6GuiTools (required version >= 6.2.6) * Qt6CoreTools (required version >= 6.2.6) * Qt6Gui * Qt6Network * Qt6Designer * Qt6OpenGL * Qt6QmlTools (required version >= 6.2.6) * Qt6Qml * Qt6Quick * Qt6QuickWidgets * Qt6Svg Required for widget SVG export. * Qt6Test * Qt6ScxmlTools (required version >= 6.2.6) * Qt6Scxml (required version >= 5.8) * Qt6Help * Qt6LinguistTools * Qt6WidgetsTools (required version >= 6.2.6) * Qt6Widgets * QmlLint, Validate QML code. -- The following RECOMMENDED packages have been found: * Qt6Concurrent Required for the GammaRay launcher process list. -- The following REQUIRED packages have been found: * Qt (required version >= 5.5) * Qt6, -- The following features have been disabled: * Option GAMMARAY_PROBE_ONLY_BUILD, Build only an additional probe configuration for an already existing launcher. * Option GAMMARAY_CLIENT_ONLY_BUILD, Build the client part only. * Option GAMMARAY_INSTALL_QT_LAYOUT, Install into Qt directory layout. * Option GAMMARAY_STATIC_PROBE, Build the probe as static library for compile-time injection. * Option GAMMARAY_ENFORCE_QT_ASSERTS, Force QT_ASSERT in all builds. * Option GAMMARAY_DISABLE_FEEDBACK, Disable user feedback support. * Option GAMMARAY_USE_PCH, Enable Precompiled Headers support * Option GAMMARAY_CORE_ONLY_LAUNCHER, Only use QtCore in the CLI launcher (breaks style injector, but is needed for Boot2Qt compatibility) * QtScript debugger, Requires QtScript and QtScriptTools. * ELF ABI detection, Automatic probe ABI detection on ELF-based systems. Requires elf.h. -- The following OPTIONAL packages have not been found: * Qt63DAnimation * Qt63DExtras * Qt63DInput * Qt63DLogic * Qt63DRender * Qt63DQuick * Qt6Bluetooth * Qt6Location * Qt6Positioning * Qt6QmlCompilerPlus * Vulkan * WrapVulkanHeaders * Qt6Script * Qt6ScriptTools * Qt6WebEngineWidgets * Qt6WaylandCompositor * Qt6IviCore (required version >= 1.1) * Qt6IviVehicleFunctions (required version >= 1.1) * Qt6IviMedia (required version >= 1.1) * KF6CoreAddons, KDE KCoreAddons Framework, Required for the KJob tracker plug-in. * PkgConfig * Wayland (required version >= 1.12), C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients, Needed for the QtWayland compositor inspector plug-in. * Doxygen, API Documentation system, Needed to build the API documentation. -- The following RECOMMENDED packages have not been found: * KF6SyntaxHighlighting (required version >= 5.28), Syntax highlighting for code editor. -- Configuring done -- Generating done -- Build files have been written to: D:/src/projects/GammaRay/cmake-build-release-mingw [Finished] ```
Here is the git patch that helped to overcome the issue: ``` diff --git a/common/remoteviewinterface.cpp b/common/remoteviewinterface.cpp index 6af71df1f..d33beecb4 100644 --- a/common/remoteviewinterface.cpp +++ b/common/remoteviewinterface.cpp @@ -110,7 +110,7 @@ QDataStream &operator<<(QDataStream &s, const QList &po return s; } -#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 6) template void setPointValue(QDataStream &s, TouchPoint &p, void (TouchPoint::*func)(T)) { @@ -136,7 +136,7 @@ QDataStream &operator>>(QDataStream &s, QList &points) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) for (int i = 0; i < count; ++i) { -#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 6) QMutableEventPoint p; #else QEventPoint p; @@ -160,14 +160,14 @@ QDataStream &operator>>(QDataStream &s, QList &points) quint64 v; s >> v; -#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 6) p.setPressTimestamp(v); #else QMutableEventPoint::setPressTimestamp(p, v); #endif s >> v; -#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 6) p.setTimestamp(v); #else QMutableEventPoint::setTimestamp(p, v); diff --git a/ui/remoteviewwidget.cpp b/ui/remoteviewwidget.cpp index 60c433e91..4918b6ffc 100644 --- a/ui/remoteviewwidget.cpp +++ b/ui/remoteviewwidget.cpp @@ -899,7 +899,7 @@ QTouchEvent::TouchPoint RemoteViewWidget::mapToSource(const QTouchEvent::TouchPo #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -#if QT_VERSION > QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION > QT_VERSION_CHECK(6, 2, 6) QMutableEventPoint::update(point, p); #define SET_POINT_VALUE(func, val) \ QMutableEventPoint::func(p, (val)) @@ -927,7 +927,7 @@ QTouchEvent::TouchPoint RemoteViewWidget::mapToSource(const QTouchEvent::TouchPo SET_POINT_VALUE(setPressTimestamp, point.pressTimestamp()); SET_POINT_VALUE(setEllipseDiameters, point.ellipseDiameters()); -#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) +#if QT_VERSION <= QT_VERSION_CHECK(6, 2, 6) p = mut; #endif ```

I faced the same issue back when I used Qt 6.2.4 and it was fixed in a similar way.

QMutableEventPoint does not have update method and, in general, the code under #if is not compatible with Qt 6.2.x Seems like these checks were written when qt 6.2,4 and 6.2.6 were not released yet and meant "future" releases.

Could you please have a look? If any additional details are needed please let me know.

ferdnyc commented 1 year ago

The changes to make QMutableEventPoint private were indeed targeted at Qt 6.3, so any Qt 6.2.* should still be included there. I'd say the correct conditional to use is really:

#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)

That'll future-proof against any possible (though very unlikely) subsequent releases of Qt 6.2.7, 6.2.8, etc...

Waqar144 commented 1 year ago

Thanks.

staticssleever668 commented 1 year ago

I was just passing by, it seems to me that in 8e67bbfa668d3cf683cb1446c3a4a054d2d1d588 the version in checks was updated, but the comparison operator was not (unlike in https://github.com/KDAB/GammaRay/issues/784#issuecomment-1544693063). Is that right?

Waqar144 commented 1 year ago

Will check sometime this week. PRs welcome.

ferdnyc commented 1 year ago

Ah, yes, @staticssleever668 is correct — the comparisons were left at <=, which will inadvertently exclude Qt version 6.3.0 (exactly and only). I'll submit a quick PR.

ferdnyc commented 1 year ago

This should now be fixed, GammaRay built for Qt 6.3.0 and above will treat QMutableEventPoint as a non-instantiable class, when built for any lower version 6.0.0–6.2.9999 it will create local instances.