Due to a bug, the version of the QT library was not checked at configure time for systems using pkg-config. Without any check at configure time, the build process stopped with unexplicative errors on systems with QT versions not supported.
This PR introduces the control of the version of the QT library, with a warning, or an error, at configure time, if the installed version is not supported.
Tested in all the following cases (all combinations):
on Debian Jessie (QT 5.3.2) and on Debian Stretch (QT 5.7.1)
with depends system (QT 5.9.7) enabled and disabled
with --with-gui and --without-gui on configure command line
Since the current 0.18 branch is affected, with compilation errors on some systems, like Debian Jessie (EOL on June 30, 2020), I suggest to include this low impact PR in 0.18.
fanquake added the label
Build system
on Mar 30, 2019
MarcoFalke renamed this:
Check QT library version
build: Check QT library version
on Mar 30, 2019
MarcoFalke added the label
Needs gitian build
on Mar 30, 2019
MarcoFalke added this to the milestone 0.18.1
on Mar 30, 2019
MarcoFalke added the label
Needs backport
on Mar 30, 2019
DrahtBot removed the label
Needs gitian build
on Mar 31, 2019
fanquake requested review from theuni
on Apr 16, 2019
laanwj
commented at 6:40 pm on May 16, 2019:
member
Concept ACK, can you take a look at the build system changes please @theuni
in
build-aux/m4/bitcoin_qt.m4:443
in
9d74d35dfcoutdated
I think it is consistent. “Check that QT > 5.7” means that it is 5.8 or more. This is the same as above: “check that QT > 5.4”, that means it is 5.5 or more. The same message is used some rows above (275):
in
build-aux/m4/bitcoin_qt.m4:102
in
25e43fcd48outdated
96@@ -99,6 +97,12 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
97 BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])
98 fi
99100+ BITCOIN_QT_CHECK([
101+ if test "x$bitcoin_cv_qt551" != xyes; then
102+ BITCOIN_QT_FAIL([Qt version not supported])
configure shouldn’t fail unless –with-gui is explicitly specified. Otherwise, it should just turn off GUI support…
lucayepa
commented at 8:28 pm on November 4, 2019:
Yes, this is exactly the behavior. BITCOIN_QT_FAIL fails only if GUI has been requested. If not, it generates a warning. On a machine with Qt version 5.3.2 I get:
0configure -> WARNING: Qt version not supported; bitcoin-qt frontend will not be built
1configure --with-gui -> error: Qt version not supported
2configure --without-gui -> no errors nor warnings
luke-jr changes_requested
hebasto
commented at 9:52 pm on December 28, 2019:
member
Concept ACK.
in
build-aux/m4/bitcoin_qt.m4:259
in
25e43fcd48outdated
254@@ -252,9 +255,9 @@ dnl ----
255256 dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
257 dnl Requires: INCLUDES must be populated as necessary.
258-dnl Output: bitcoin_cv_qt5=yes|no
259-AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
260- AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[
261+dnl Output: bitcoin_cv_qt551=yes|no
262+AC_DEFUN([_BITCOIN_QT_CHECK_QT551],[
hebasto
commented at 9:57 pm on December 28, 2019:
0AC_DEFUN([_BITCOIN_QT_CHECK_MINIMUM_REQUIRED],[
… to minimize future changes.
lucayepa
commented at 10:07 pm on January 24, 2020:
Ack.
in
build-aux/m4/bitcoin_qt.m4:260
in
25e43fcd48outdated
254@@ -252,9 +255,9 @@ dnl ----
255256 dnl Internal. Check included version of Qt against minimum specified in doc/dependencies.md
257 dnl Requires: INCLUDES must be populated as necessary.
258-dnl Output: bitcoin_cv_qt5=yes|no
259-AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
260- AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[
261+dnl Output: bitcoin_cv_qt551=yes|no
262+AC_DEFUN([_BITCOIN_QT_CHECK_QT551],[
263+ AC_CACHE_CHECK(for Qt >= 5.5.1, bitcoin_cv_qt551,[
hebasto
commented at 9:59 pm on December 28, 2019:
lucayepa
commented at 10:07 pm on January 24, 2020:
Ack
in
build-aux/m4/bitcoin_qt.m4:408
in
25e43fcd48outdated
406@@ -404,8 +407,6 @@ AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
407 dnl Internal. Find Qt libraries using pkg-config.
408 dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
hebasto
commented at 10:05 pm on December 28, 2019:
Is this comment still relevant?
lucayepa
commented at 10:14 pm on January 24, 2020:
No. It is not. I remove it.
hebasto changes_requested
hebasto
commented at 10:12 pm on December 28, 2019:
member
Please quote macro arguments with [ and ] consistently.
DrahtBot
commented at 1:28 am on December 29, 2019:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#18361 (build: Make the help string for –with-gui configure option unambiguous by hebasto)
#18298 (build: Fix Qt processing of configure script for depends with DEBUG=1 by hebasto)
#18297 (build: Use pkg-config in BITCOIN_QT_CONFIGURE for all hosts including Windows by hebasto)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
in
build-aux/m4/bitcoin_qt.m4:432
in
25e43fcd48outdated
0dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])`1dnl -------------------------------------------------------------------2dnl Since: 0.183dnl
4dnl Check to see whether a particular set of modules exists. Similar to
5dnl PKG_CHECK_MODULES(), but does not set variables or print errors
Does this usage of PKG_CHECK_EXISTS macro is correct?
Fixes issue #15688
Due to a bug, in systems using pkg-config, the version of the Qt library is
not checked at configure time. Without any check, when Qt version is not
supported, the build process stops with unexpleined errors.
This PR introduces the control of the version of the QT library, returning
a warning or an error at configure time, when the installed version is not
supported.
284+dnl Internal. Check if the included version of Qt is >= 5.8.
285 dnl Requires: INCLUDES must be populated as necessary.
286 dnl Output: bitcoin_cv_qt58=yes|no
287 AC_DEFUN([_BITCOIN_QT_CHECK_QT58],[
288- AC_CACHE_CHECK(for > Qt 5.7, bitcoin_cv_qt58,[
289+ AC_CACHE_CHECK(for >= Qt 5.8, bitcoin_cv_qt58,[
hebasto
commented at 9:26 am on January 26, 2020:
member
ACK35c46bcb68344bb692dcc71a7c4dd6ac4442a920, tested on Linux Mint 19.3 with system Qt 5.9.5:
0$ qmake -qt=qt5_system -v
1QMake version 3.1
2Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
Tests withpkg-config usage
0$ ./autogen.sh
1$ ./configure
2...
3checking for QT5... yes
4checking for QT_TEST... yes
5checking for QT_DBUS... yes
6checking for Qt >= 5.5.1... yes
7checking for Qt >= 5.8.0... yes
8checking for static Qt... no
9checking whether -fPIE can be used with this Qt config... no
10checking for moc-qt5... no
11checking for moc5... no
12checking for moc... /usr/lib/qt5/bin/moc
13checking for uic-qt5... no
14checking for uic5... no
15checking for uic... /usr/lib/qt5/bin/uic
16checking for rcc-qt5... no
17checking for rcc5... no
18checking for rcc... /usr/lib/qt5/bin/rcc
19checking for lrelease-qt5... no
20checking for lrelease5... no
21checking for lrelease... /usr/lib/qt5/bin/lrelease
22checking for lupdate-qt5... no
23checking for lupdate5... no
24checking for lupdate... /usr/lib/qt5/bin/lupdate
25checking whether to build Bitcoin Core GUI... yes (Qt5)
26...
To test alternative behavior the following patch was applied:
0$ ./autogen.sh
1$ ./configure
2checking for QT5... yes
3checking for QT_TEST... yes
4checking for QT_DBUS... yes
5checking for Qt >= 5.9.6... no
6checking for Qt >= 5.8.0... yes
7configure: WARNING: Qt version not supported; bitcoin-qt frontend will not be built
8checking whether to build Bitcoin Core GUI... no
9...
0$ ./autogen.sh
1$ ./configure --with-gui=qt5
2...
3checking for QT5... yes
4checking for QT_TEST... yes
5checking for QT_DBUS... yes
6checking for Qt >= 5.9.6... no
7checking for Qt >= 5.8.0... yes
8configure: error: Qt version not supported
and --with-qt-incdir command-line option was passed to configure script.
0$ ./autogen.sh
1$ ./configure --with-qt-incdir=/usr/include/x86_64-linux-gnu/qt5
2...
3checking for Qt >= 5.5.1... yes
4checking for >= Qt 5.8... yes
5...
6checking whether to build Bitcoin Core GUI... yes (Qt5)
7...
0$ ./autogen.sh
1$ ./configure --with-qt-incdir=/usr/include/x86_64-linux-gnu/qt5
2...
3checking for Qt >= 5.9.6... no
4checking for >= Qt 5.8... yes
5...
6configure: WARNING: Qt version not supported; bitcoin-qt frontend will not be built
7checking whether to build Bitcoin Core GUI... no
8...
laanwj removed this from the milestone 0.18.2
on Jan 27, 2020
hebasto
commented at 10:30 am on March 17, 2020:
member
It seems we should consider an alternative solution based on #18297.
fanquake
commented at 7:26 am on May 15, 2020:
member
I agree that something like #18297 is the way forward here, so I’m going to close. This also would not be getting backported to 0.18 or 0.19 at this point. Thanks for the contribution & sorry it didn’t make it into the repo.
fanquake closed this
on May 15, 2020
fanquake removed the label
Needs backport (0.18)
on May 15, 2020
fanquake removed the label
Needs backport (0.19)
on May 15, 2020
fanquake referenced this in commit
38c13a4a60
on Aug 24, 2020
sidhujag referenced this in commit
dafb919f5c
on Aug 24, 2020
xdustinface referenced this in commit
3e8687603d
on Feb 17, 2021
gades referenced this in commit
0e12d032a0
on Jun 27, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-06-09 03:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me