Build qt6.5.3 from source fails due to protobuf
-
Hello Forum,
I tried to compile qt6.5.3 from source and it fails with:cmake --build . --parallel [714/11191] Check QtWebEngine support QtWebEngine will not be built: node.js version 12 or later is required. [715/11191] Check QtPdf support QtPdf will not be built: node.js version 12 or later is required. [876/11191] Building CXX object qtgrpc/src/tools/qtprotobufgen/CMakeFiles/qtprotobufgen.dir/qprotobufgenerator.cpp.o FAILED: qtgrpc/src/tools/qtprotobufgen/CMakeFiles/qtprotobufgen.dir/qprotobufgenerator.cpp.o /usr/bin/c++ -DPROTOBUF_USE_DLLS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_NO_AS_CONST=1 -DQT_NO_DEBUG -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen -I/home/sg/LLT/tmp/test/qt6/build/qtgrpc/src/tools/qtprotobufgen -I/home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotoccommon -I/home/sg/LLT/tmp/test/qt6/qtbase/mkspecs/linux-g++ -I/home/sg/LLT/tmp/test/qt6/build/qtbase/include -DNDEBUG -O2 -std=c++17 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wsuggest-override -MD -MT qtgrpc/src/tools/qtprotobufgen/CMakeFiles/qtprotobufgen.dir/qprotobufgenerator.cpp.o -MF qtgrpc/src/tools/qtprotobufgen/CMakeFiles/qtprotobufgen.dir/qprotobufgenerator.cpp.o.d -o qtgrpc/src/tools/qtprotobufgen/CMakeFiles/qtprotobufgen.dir/qprotobufgenerator.cpp.o -c /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp: In member function ‘virtual bool QtProtobuf::QProtobufGenerator::Generate(const google::protobuf::FileDescriptor*, const std::string&, google::protobuf::compiler::GeneratorContext*, std::string*) const’: /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp:43:21: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is private within this context 43 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ~~~~~~~~~~~~^~ In file included from /usr/include/google/protobuf/compiler/retention.h:34, from /usr/include/google/protobuf/compiler/code_generator.h:46, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotoccommon/generatorbase.h:8, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.h:8, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp:5: /usr/include/google/protobuf/descriptor.h:2857:31: note: declared private here 2857 | inline FileDescriptor::Syntax FileDescriptor::syntax() const { | ^~~~~~~~~~~~~~ /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp:43:21: warning: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is deprecated: Syntax is deprecated in favor of editions. Please use targeted feature helpers instead (e.g. has_presence, is_packed, requires_utf8_validation, etc). [-Wdeprecated-declarations] 43 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ~~~~~~~~~~~~^~ /usr/include/google/protobuf/descriptor.h:2857:31: note: declared here 2857 | inline FileDescriptor::Syntax FileDescriptor::syntax() const { | ^~~~~~~~~~~~~~ /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotobufgen/qprotobufgenerator.cpp:43:43: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::SYNTAX_PROTO3’ is private within this context 43 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ^~~~~~~~~~~~~ /usr/include/google/protobuf/descriptor.h:1907:5: note: declared private here 1907 | SYNTAX_PROTO3 = 3, | ^~~~~~~~~~~~~ [881/11191] Building CXX object qtgrpc/src/tools/qtgrpcgen/CMakeFiles/qtgrpcgen.dir/qgrpcgenerator.cpp.o FAILED: qtgrpc/src/tools/qtgrpcgen/CMakeFiles/qtgrpcgen.dir/qgrpcgenerator.cpp.o /usr/bin/c++ -DPROTOBUF_USE_DLLS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_NO_AS_CONST=1 -DQT_NO_DEBUG -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen -I/home/sg/LLT/tmp/test/qt6/build/qtgrpc/src/tools/qtgrpcgen -I/home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotoccommon -I/home/sg/LLT/tmp/test/qt6/qtbase/mkspecs/linux-g++ -I/home/sg/LLT/tmp/test/qt6/build/qtbase/include -DNDEBUG -O2 -std=c++17 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wsuggest-override -MD -MT qtgrpc/src/tools/qtgrpcgen/CMakeFiles/qtgrpcgen.dir/qgrpcgenerator.cpp.o -MF qtgrpc/src/tools/qtgrpcgen/CMakeFiles/qtgrpcgen.dir/qgrpcgenerator.cpp.o.d -o qtgrpc/src/tools/qtgrpcgen/CMakeFiles/qtgrpcgen.dir/qgrpcgenerator.cpp.o -c /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp: In member function ‘virtual bool QtGrpc::QGrpcGenerator::Generate(const google::protobuf::FileDescriptor*, const std::string&, google::protobuf::compiler::GeneratorContext*, std::string*) const’: /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp:37:21: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is private within this context 37 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ~~~~~~~~~~~~^~ In file included from /usr/include/google/protobuf/compiler/retention.h:34, from /usr/include/google/protobuf/compiler/code_generator.h:46, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtprotoccommon/generatorbase.h:8, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.h:8, from /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp:4: /usr/include/google/protobuf/descriptor.h:2857:31: note: declared private here 2857 | inline FileDescriptor::Syntax FileDescriptor::syntax() const { | ^~~~~~~~~~~~~~ /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp:37:21: warning: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::syntax() const’ is deprecated: Syntax is deprecated in favor of editions. Please use targeted feature helpers instead (e.g. has_presence, is_packed, requires_utf8_validation, etc). [-Wdeprecated-declarations] 37 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ~~~~~~~~~~~~^~ /usr/include/google/protobuf/descriptor.h:2857:31: note: declared here 2857 | inline FileDescriptor::Syntax FileDescriptor::syntax() const { | ^~~~~~~~~~~~~~ /home/sg/LLT/tmp/test/qt6/qtgrpc/src/tools/qtgrpcgen/qgrpcgenerator.cpp:37:43: error: ‘google::protobuf::FileDescriptor::Syntax google::protobuf::FileDescriptor::SYNTAX_PROTO3’ is private within this context 37 | if (file->syntax() != FileDescriptor::SYNTAX_PROTO3) { | ^~~~~~~~~~~~~ /usr/include/google/protobuf/descriptor.h:1907:5: note: declared private here 1907 | SYNTAX_PROTO3 = 3, | ^~~~~~~~~~~~~ [885/11191] Compiling syncqt [1/1] Cleaning all built files... Cleaning... 2 files. [1/2] Building CXX object CMakeFiles/syncqt.dir/main.cpp.o [2/2] Linking CXX executable /home/sg/LLT/tmp/test/qt6/build/qtbase/libexec/syncqt ninja: build stopped: subcommand failed.
Maybe I have checked out the wrong commit for build or some other beginners mistake, which I am not able to spot.
First I tried with origin/6.5.3 and then the label v6.5.3, both fail with very similar, if not the same, protobuf error.
I followed the building guide: https://wiki.qt.io/Building_Qt_6_from_GitIs this an actual bug that should be reported in the bug tracker?
Has anyone advice or additional information on how to build from source? -
Addressed here: https://codereview.qt-project.org/c/qt/qtgrpc/+/488623 backported to 6.5 lts.
-
Hi and welcome to devnet,
I haven't built that module yet but which version of grpc are you using ?
-
Thank you for the answer.
I checked out the head of the "origin/6.5.3" of the qt6 repository.Commit: 0a1e4f22cdf6a099d01e4a32aace997b874c4d42 Parents: 96287a77e8645d0010695d2544e105ee6e9e4dbe Author: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org> Author Date: Mon Oct 16 2023 05:36:08 GMT+0200 (Central European Summer Time) Committer: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org> Committer Date: Tue Oct 17 2023 05:36:33 GMT+0200 (Central European Summer Time) Update submodules on '6.5.3 in qt/qt5' Change-Id: If7addaf2048bba0ba914ac94c18cbc78f3662b83 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
The qtgrpc module is at "origin/6.5.3" | "v6.5.3".
Commit: 6ea570e220681a459757aec075502fcdfca69718 Parents: 518e8f8cb1f068a826ef23888b31060f5584a557 Author: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org> Author Date: Sun Sep 24 2023 11:45:57 GMT+0200 (Central European Summer Time) Committer: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org> Committer Date: Sun Sep 24 2023 11:46:22 GMT+0200 (Central European Summer Time) Update dependencies on '6.5.3' in qt/qtgrpc Change-Id: I51872c776ae276201a52edae0e8b909a94d04028 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
You mentioned that you don't build this module. Is this not commonly build and used one?
I don't need to use grpc, and could ommit it during the build.
Since I saw no commands for ommitting certain modules I will look into the configure scripts.
Do you know how to ommit a certain module? -
configure had a help parameter which gave me the instructions on how to adjust my build to my needs.
../configure -h
When I only build qtbase it works.
../configure -cmake-file-api -submodules qtbase -prefix /install/path
I could not find a qtwidgets submodule, thus for now I assume that it is part of qtbase.
-
I have the config.summary from trying to build the qtgrpc submodule, with its dependencies.
Building for: linux-g++ (x86_64, CPU features: mmx sse sse2) Compiler: gcc 13.2.1 Build options: Mode ................................... release Optimize release build for size ........ no Fully optimize release builds (-O3) .... no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Unity Build ............................ no Using new DTAGS ........................ yes Relocatable ............................ yes Using precompiled headers .............. yes Using Link Time Optimization (LTCG) .... no Using Intel CET ........................ no Target compiler supports: x86 Intrinsics ....................... Basic VAES AVX512VBMI2 Sanitizers: Addresses ............................ no Threads .............................. no Memory ............................... no Fuzzer (instrumentation only) ........ no Undefined ............................ no Build parts ............................ libs tools Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... yes Qt Gui ................................. yes Qt Network ............................. yes Qt PrintSupport ........................ yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes udev ................................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no OpenSSL 3.0 ............................ yes Using system zlib ...................... yes Zstandard support ...................... yes Thread support ......................... yes Common build options: Linker can resolve circular dependencies yes Qt Core: backtrace .............................. yes DoubleConversion ....................... yes Using system DoubleConversion ........ yes GLib ................................... yes ICU .................................... yes Using system libb2 ..................... no Built-in copy of the MIME database ..... yes cpp/winrt base ......................... no Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PCRE2 .................................. yes Using system PCRE2 ................... yes CLONE_PIDFD support in forkfd .......... yes Application permissions ................ no Qt Sql: SQL item models ........................ yes Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes DTLS ................................... yes OCSP-stapling .......................... yes SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. yes Brotli Decompression Support ........... yes qIsEffectiveTLD() ...................... yes Built-in publicsuffix database ....... yes System publicsuffix database ......... yes Core tools: Android deployment tool ................ yes macOS deployment tool .................. no Windows deployment tool ................ no qmake .................................. yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ yes Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... yes PNG .................................. yes Using system libpng ................ yes Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... yes MarkdownWriter ....................... yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... yes OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... yes HiRes wheel support in libinput ........ yes INTEGRITY HID .......................... no mtdev .................................. yes tslib .................................. yes xkbcommon .............................. yes X11 specific: XLib ................................. yes XCB Xlib ............................. yes EGL on X11 ........................... yes xkbcommon-x11 ........................ yes xcb-sm ............................... no QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... yes EGLFS GBM ............................ yes EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no EGLFS X11 ............................ yes LinuxFB ................................ yes VNC .................................... yes VK_KHR_display ......................... no QNX: lgmon ................................ no IMF .................................. no XCB: Using system-provided xcb-xinput ..... no GL integrations: GLX Plugin ......................... no XCB GLX .......................... no EGL-X11 Plugin ..................... no Windows: Direct 2D ............................ no Direct 2D 1.1 ........................ no DirectWrite .......................... no DirectWrite 3 ........................ no Qt Widgets: GTK+ ................................... yes Styles ................................. Fusion Windows Qt Testlib: Tester for item models ................. yes Batch tests ............................ no Qt PrintSupport: CUPS ................................... yes Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite ................................. yes Using system provided SQLite ......... no Further Image Formats: JasPer ................................. yes MNG .................................... yes TIFF ................................... yes Using system libtiff ................. yes WEBP ................................... yes Using system libwebp ................. yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML just-in-time compiler .............. yes QML XML http request ................... yes QML Locale ............................. yes Qt QML Models: QML list model ......................... yes QML delegate model ..................... yes Qt Quick: AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes TreeView item .......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Calendar support ....................... yes Qt Quick Controls 2: Styles ................................. Basic Fusion Imagine iOS Material Universal macOS Windows Qt Protobuf tools: Qt Protobuf generator .................. yes Qt GRPC: gRPC support ........................... yes Native gRPC support .................... yes Qt GRPC tools: Qt GRPC generator ...................... yes
How do I manually configre the qtgrpc submodule?
qtbase folder contains a configre script, but qtgrpc does not. -
@SGaist
I used the suggested commands.
folder: /home/sg/LLT/tmp/test/inst_path_grpc_test
qt-cmake command: /home/sg/LLT/tmp/test/qt6/build/qtbase/bin/qt-cmake
argument for qt-cmake: /home/sg/LLT/tmp/test/qt6/qtgrpc~/LLT/tmp/test/inst_path_grpc_test ❯ /home/sg/LLT/tmp/test/qt6/build/qtbase/bin/qt-cmake /home/sg/LLT/tmp/test/qt6/qtgrpc -- The CXX compiler identification is GNU 13.2.1 -- The C compiler identification is GNU 13.2.1 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Found WrapAtomic: TRUE -- Found OpenGL: /usr/lib/libOpenGL.so -- Found WrapOpenGL: TRUE -- Found XKB: /usr/lib/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") CMake Error at /home/sg/LLT/tmp/test/qt6/qtbase/cmake/QtBuild.cmake:394 (message): Unknown platform linux-g++ Known platforms: modules preliminary qconfig.pri qmodule.pri Call Stack (most recent call first): /home/sg/LLT/tmp/test/qt6/qtbase/cmake/QtSetup.cmake:321 (include) /home/sg/LLT/tmp/test/qt6/build/qtbase/lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:249 (include) /home/sg/LLT/tmp/test/qt6/build/qtbase/lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:391 (qt_build_internals_set_up_private_api) /home/sg/LLT/tmp/test/qt6/build/qtbase/lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:577 (qt_build_repo_begin) CMakeLists.txt:29 (qt_build_repo) -- Configuring incomplete, errors occurred!
I can not understand how I should figure out the qtgrpc version from this.
-
@SGaist
Okay, currently I have grpc 1.59.2-1 installed.Previously I had following version installed.
@SiGa said in Build qt6.5.3 from source fails due to protobuf:I could not figure out the version by examining the qtgrpc submodule.
Then I installed 1.58.1-1 onto my machine.
Is this the version you are asking for?
Build again and it still fails. -
Addressed here: https://codereview.qt-project.org/c/qt/qtgrpc/+/488623 backported to 6.5 lts.
-