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

leveldb: integrate leveldb into our buildsystem #7911

Merged
merged 1 commit into from Apr 22, 2016

Conversation

Projects
None yet
5 participants
@theuni
Member

theuni commented Apr 19, 2016

See discussion at bitcoin-core/leveldb-old#11

leveldb's buildsystem causes us a few problems:

  • breaks out-of-tree builds
  • forces flags used for some tools
  • limits cross builds

Rather than continuing to add wrappers around it, simply integrate it into our build.

leveldb: integrate leveldb into our buildsystem
leveldb's buildsystem causes us a few problems:
- breaks out-of-tree builds
- forces flags used for some tools
- limits cross builds

Rather than continuing to add wrappers around it, simply integrate it into our
build.
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

utACK (will test later).

More info: this should fix both issues from "Out-of-tree builds don't currently work #7466": out-of-tree builds and LLVM lto ar.

Member

laanwj commented Apr 20, 2016

utACK (will test later).

More info: this should fix both issues from "Out-of-tree builds don't currently work #7466": out-of-tree builds and LLVM lto ar.

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Apr 20, 2016

Member

Why not just autotools-ify our LevelDB fork?

Member

luke-jr commented Apr 20, 2016

Why not just autotools-ify our LevelDB fork?

@theuni

This comment has been minimized.

Show comment
Hide comment
@theuni

theuni Apr 20, 2016

Member

@luke-jr That's exactly what this is. Upstream is dormant enough that there's no need to add an abstraction layer. We were already overriding their entire buildsystem, all we were missing was file enumeration.

Member

theuni commented Apr 20, 2016

@luke-jr That's exactly what this is. Upstream is dormant enough that there's no need to add an abstraction layer. We were already overriding their entire buildsystem, all we were missing was file enumeration.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 20, 2016

Member

utACK

Member

sipa commented Apr 20, 2016

utACK

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

Why not just autotools-ify our LevelDB fork?

There's a (quite succesful) attempt by @kleetus here: bitcoin-core/leveldb-old#11

If you manage to get upstream to merge and maintain that in favor of their current bag of hacks, that'd be an excellent option. We can switch to that if that happens. However the chances of that are thought to be slim, so the most efficient and least error-prone way (less "moving parts") for us to solve this right now is the way @theuni did.

Member

laanwj commented Apr 20, 2016

Why not just autotools-ify our LevelDB fork?

There's a (quite succesful) attempt by @kleetus here: bitcoin-core/leveldb-old#11

If you manage to get upstream to merge and maintain that in favor of their current bag of hacks, that'd be an excellent option. We can switch to that if that happens. However the chances of that are thought to be slim, so the most efficient and least error-prone way (less "moving parts") for us to solve this right now is the way @theuni did.

@luke-jr

This comment has been minimized.

Show comment
Hide comment
@luke-jr

luke-jr Apr 20, 2016

Member

src/Makefile.leveldb.include isn't inside src/leveldb...

Member

luke-jr commented Apr 20, 2016

src/Makefile.leveldb.include isn't inside src/leveldb...

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

src/Makefile.leveldb.include isn't inside src/leveldb...

That's on purpose.
You are basically repeating the discussion done months ago in bitcoin-core/leveldb-old#11 and #7466.
src/leveldb is still a subtree containing the upstream repository, we shouldn't add files private to ourselves (which aren't useful on their own) there.

Member

laanwj commented Apr 20, 2016

src/Makefile.leveldb.include isn't inside src/leveldb...

That's on purpose.
You are basically repeating the discussion done months ago in bitcoin-core/leveldb-old#11 and #7466.
src/leveldb is still a subtree containing the upstream repository, we shouldn't add files private to ourselves (which aren't useful on their own) there.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 20, 2016

Member

I think both things can be done in parallel: we could try to get an autotoolsification of leveldb accepted upstream (so it benefits more people than just Bitcoin-related projects), and switch to an overridden build system like this PR in the mean time. If the autotoolsification gets upstreamed, we can always switch back.

Member

sipa commented Apr 20, 2016

I think both things can be done in parallel: we could try to get an autotoolsification of leveldb accepted upstream (so it benefits more people than just Bitcoin-related projects), and switch to an overridden build system like this PR in the mean time. If the autotoolsification gets upstreamed, we can always switch back.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

@sipa Indeed

Member

laanwj commented Apr 20, 2016

@sipa Indeed

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

Tested ACK a4625ac using both gcc and llvm (+flto).
(but this reveals another problem, see below)

Member

laanwj commented Apr 20, 2016

Tested ACK a4625ac using both gcc and llvm (+flto).
(but this reveals another problem, see below)

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

OK this is really, really strange. With this patch:

  • When I compile the GUI from the bitcoin directory itself, it works as expected.
  • When I build the GUI in an out-of-tree build, I cannot get it to select tabs. When I click, say the "Receive" tab nothing happens, the button selects but it doesn't switch the page. The rest - even the debug window - seems to work.

I first thought I had found a strange clang issue, but this happens with gcc as well. I cannot wrap my head around this, tried adding debug statements over the place but it's as if the QAction (overviewAction, etc) doesn't generate a signal when building out-of-tree.

  • this is not due to a polluted bitcoin repository shared between the out-of-tree and normal build - I tried the same from a clean checkout
Member

laanwj commented Apr 20, 2016

OK this is really, really strange. With this patch:

  • When I compile the GUI from the bitcoin directory itself, it works as expected.
  • When I build the GUI in an out-of-tree build, I cannot get it to select tabs. When I click, say the "Receive" tab nothing happens, the button selects but it doesn't switch the page. The rest - even the debug window - seems to work.

I first thought I had found a strange clang issue, but this happens with gcc as well. I cannot wrap my head around this, tried adding debug statements over the place but it's as if the QAction (overviewAction, etc) doesn't generate a signal when building out-of-tree.

  • this is not due to a polluted bitcoin repository shared between the out-of-tree and normal build - I tried the same from a clean checkout
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

@cfields I think I found the issue, or at least one symptom - the .moc file is different between the out-of-tree and normal builds:

--- bitcoin/src/qt/moc_bitcoingui.cpp   2016-04-20 15:31:42.627847820 +0200
+++ bitcoin-build/src/qt/moc_bitcoingui.cpp 2016-04-20 15:17:04.295881358 +0200
@@ -5,7 +5,7 @@
 ** WARNING! All changes made in this file will be lost!
 *****************************************************************************/

-#include "qt/bitcoingui.h"
+#include "../../bitcoin-clean/src/qt/bitcoingui.h"
 #include <QtCore/qbytearray.h>
 #include <QtCore/qmetatype.h>
 #if !defined(Q_MOC_OUTPUT_REVISION)
@@ -18,8 +18,8 @@

 QT_BEGIN_MOC_NAMESPACE
 struct qt_meta_stringdata_BitcoinGUI_t {
-    QByteArrayData data[49];
-    char stringdata[642];
+    QByteArrayData data[28];
+    char stringdata[372];
 };
 #define QT_MOC_LITERAL(idx, ofs, len) \
     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
@@ -42,54 +42,26 @@
 QT_MOC_LITERAL(11, 111, 5),
 QT_MOC_LITERAL(12, 117, 5),
 QT_MOC_LITERAL(13, 123, 3),
-QT_MOC_LITERAL(14, 127, 19),
-QT_MOC_LITERAL(15, 147, 6),
-QT_MOC_LITERAL(16, 154, 20),
-QT_MOC_LITERAL(17, 175, 18),
-QT_MOC_LITERAL(18, 194, 9),
-QT_MOC_LITERAL(19, 204, 19),
-QT_MOC_LITERAL(20, 224, 4),
-QT_MOC_LITERAL(21, 229, 4),
-QT_MOC_LITERAL(22, 234, 7),
-QT_MOC_LITERAL(23, 242, 6),
-QT_MOC_LITERAL(24, 249, 4),
-QT_MOC_LITERAL(25, 254, 7),
-QT_MOC_LITERAL(26, 262, 5),
-QT_MOC_LITERAL(27, 268, 16),
-QT_MOC_LITERAL(28, 285, 15),
-QT_MOC_LITERAL(29, 301, 20),
-QT_MOC_LITERAL(30, 322, 17),
-QT_MOC_LITERAL(31, 340, 4),
-QT_MOC_LITERAL(32, 345, 18),
-QT_MOC_LITERAL(33, 364, 20),
-QT_MOC_LITERAL(34, 385, 11),
-QT_MOC_LITERAL(35, 397, 14),
-QT_MOC_LITERAL(36, 412, 12),
-QT_MOC_LITERAL(37, 425, 15),
-QT_MOC_LITERAL(38, 441, 30),
-QT_MOC_LITERAL(39, 472, 22),
-QT_MOC_LITERAL(40, 495, 17),
-QT_MOC_LITERAL(41, 513, 33),
-QT_MOC_LITERAL(42, 547, 6),
-QT_MOC_LITERAL(43, 554, 21),
-QT_MOC_LITERAL(44, 576, 13),
-QT_MOC_LITERAL(45, 590, 12),
-QT_MOC_LITERAL(46, 603, 14),
-QT_MOC_LITERAL(47, 618, 12),
-QT_MOC_LITERAL(48, 631, 9)
+QT_MOC_LITERAL(14, 127, 14),
+QT_MOC_LITERAL(15, 142, 12),
+QT_MOC_LITERAL(16, 155, 15),
+QT_MOC_LITERAL(17, 171, 30),
+QT_MOC_LITERAL(18, 202, 22),
+QT_MOC_LITERAL(19, 225, 17),
+QT_MOC_LITERAL(20, 243, 33),
+QT_MOC_LITERAL(21, 277, 6),
+QT_MOC_LITERAL(22, 284, 21),
+QT_MOC_LITERAL(23, 306, 13),
+QT_MOC_LITERAL(24, 320, 12),
+QT_MOC_LITERAL(25, 333, 14),
+QT_MOC_LITERAL(26, 348, 12),
+QT_MOC_LITERAL(27, 361, 9)
     },
     "BitcoinGUI\0receivedURI\0\0uri\0"
     "setNumConnections\0count\0setNumBlocks\0"
     "blockDate\0nVerificationProgress\0message\0"
-    "title\0style\0bool*\0ret\0setEncryptionStatus\0"
-    "status\0handlePaymentRequest\0"
-    "SendCoinsRecipient\0recipient\0"
-    "incomingTransaction\0date\0unit\0CAmount\0"
-    "amount\0type\0address\0label\0gotoOverviewPage\0"
-    "gotoHistoryPage\0gotoReceiveCoinsPage\0"
-    "gotoSendCoinsPage\0addr\0gotoSignMessageTab\0"
-    "gotoVerifyMessageTab\0openClicked\0"
-    "optionsClicked\0aboutClicked\0showDebugWindow\0"
+    "title\0style\0bool*\0ret\0optionsClicked\0"
+    "aboutClicked\0showDebugWindow\0"
     "showDebugWindowActivateConsole\0"
     "showHelpMessageClicked\0trayIconActivated\0"
     "QSystemTrayIcon::ActivationReason\0"
@@ -105,7 +77,7 @@
        7,       // revision
        0,       // classname
        0,    0, // classinfo
-      29,   14, // methods
+      16,   14, // methods
        0,    0, // properties
        0,    0, // enums/sets
        0,    0, // constructors
@@ -113,37 +85,24 @@
        1,       // signalCount

  // signals: name, argc, parameters, tag, flags
-       1,    1,  159,    2, 0x06,
+       1,    1,   94,    2, 0x06,

  // slots: name, argc, parameters, tag, flags
-       4,    1,  162,    2, 0x0a,
-       6,    3,  165,    2, 0x0a,
-       9,    4,  172,    2, 0x0a,
-       9,    3,  181,    2, 0x2a,
-      14,    1,  188,    2, 0x0a,
-      16,    1,  191,    2, 0x0a,
-      19,    6,  194,    2, 0x0a,
-      27,    0,  207,    2, 0x08,
-      28,    0,  208,    2, 0x08,
-      29,    0,  209,    2, 0x08,
-      30,    1,  210,    2, 0x08,
-      30,    0,  213,    2, 0x28,
-      32,    1,  214,    2, 0x08,
-      32,    0,  217,    2, 0x28,
-      33,    1,  218,    2, 0x08,
-      33,    0,  221,    2, 0x28,
-      34,    0,  222,    2, 0x08,
-      35,    0,  223,    2, 0x08,
-      36,    0,  224,    2, 0x08,
-      37,    0,  225,    2, 0x08,
-      38,    0,  226,    2, 0x08,
-      39,    0,  227,    2, 0x08,
-      40,    1,  228,    2, 0x08,
-      43,    1,  231,    2, 0x08,
-      43,    0,  234,    2, 0x28,
-      45,    0,  235,    2, 0x08,
-      46,    0,  236,    2, 0x08,
-      47,    2,  237,    2, 0x08,
+       4,    1,   97,    2, 0x0a,
+       6,    3,  100,    2, 0x0a,
+       9,    4,  107,    2, 0x0a,
+       9,    3,  116,    2, 0x2a,
+      14,    0,  123,    2, 0x08,
+      15,    0,  124,    2, 0x08,
+      16,    0,  125,    2, 0x08,
+      17,    0,  126,    2, 0x08,
+      18,    0,  127,    2, 0x08,
+      19,    1,  128,    2, 0x08,
+      22,    1,  131,    2, 0x08,
+      22,    0,  134,    2, 0x28,
+      24,    0,  135,    2, 0x08,
+      25,    0,  136,    2, 0x08,
+      26,    2,  137,    2, 0x08,

  // signals: parameters
     QMetaType::Void, QMetaType::QString,    3,
@@ -153,30 +112,17 @@
     QMetaType::Void, QMetaType::Int, QMetaType::QDateTime, QMetaType::Double,    5,    7,    8,
     QMetaType::Void, QMetaType::QString, QMetaType::QString, QMetaType::UInt, 0x80000000 | 12,   10,    9,   11,   13,
     QMetaType::Void, QMetaType::QString, QMetaType::QString, QMetaType::UInt,   10,    9,   11,
-    QMetaType::Void, QMetaType::Int,   15,
-    QMetaType::Bool, 0x80000000 | 17,   18,
-    QMetaType::Void, QMetaType::QString, QMetaType::Int, 0x80000000 | 22, QMetaType::QString, QMetaType::QString, QMetaType::QString,   20,   21,   23,   24,   25,   26,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void, 0x80000000 | 41,   42,
-    QMetaType::Void, QMetaType::Bool,   44,
+    QMetaType::Void, 0x80000000 | 20,   21,
+    QMetaType::Void, QMetaType::Bool,   23,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
-    QMetaType::Void, QMetaType::QString, QMetaType::Int,   10,   48,
+    QMetaType::Void, QMetaType::QString, QMetaType::Int,   10,   27,

        0        // eod
 };
@@ -191,31 +137,17 @@
         case 2: _t->setNumBlocks((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< const QDateTime(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
         case 3: _t->message((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< uint(*)>(_a[3])),(*reinterpret_cast< bool*(*)>(_a[4]))); break;
         case 4: _t->message((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< uint(*)>(_a[3]))); break;
-        case 5: _t->setEncryptionStatus((*reinterpret_cast< int(*)>(_a[1]))); break;
-        case 6: { bool _r = _t->handlePaymentRequest((*reinterpret_cast< const SendCoinsRecipient(*)>(_a[1])));
-            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
-        case 7: _t->incomingTransaction((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< const CAmount(*)>(_a[3])),(*reinterpret_cast< const QString(*)>(_a[4])),(*reinterpret_cast< const QString(*)>(_a[5])),(*reinterpret_cast< const QString(*)>(_a[6]))); break;
-        case 8: _t->gotoOverviewPage(); break;
-        case 9: _t->gotoHistoryPage(); break;
-        case 10: _t->gotoReceiveCoinsPage(); break;
-        case 11: _t->gotoSendCoinsPage((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 12: _t->gotoSendCoinsPage(); break;
-        case 13: _t->gotoSignMessageTab((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 14: _t->gotoSignMessageTab(); break;
-        case 15: _t->gotoVerifyMessageTab((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 16: _t->gotoVerifyMessageTab(); break;
-        case 17: _t->openClicked(); break;
-        case 18: _t->optionsClicked(); break;
-        case 19: _t->aboutClicked(); break;
-        case 20: _t->showDebugWindow(); break;
-        case 21: _t->showDebugWindowActivateConsole(); break;
-        case 22: _t->showHelpMessageClicked(); break;
-        case 23: _t->trayIconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
-        case 24: _t->showNormalIfMinimized((*reinterpret_cast< bool(*)>(_a[1]))); break;
-        case 25: _t->showNormalIfMinimized(); break;
-        case 26: _t->toggleHidden(); break;
-        case 27: _t->detectShutdown(); break;
-        case 28: _t->showProgress((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
+        case 5: _t->optionsClicked(); break;
+        case 6: _t->aboutClicked(); break;
+        case 7: _t->showDebugWindow(); break;
+        case 8: _t->showDebugWindowActivateConsole(); break;
+        case 9: _t->showHelpMessageClicked(); break;
+        case 10: _t->trayIconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
+        case 11: _t->showNormalIfMinimized((*reinterpret_cast< bool(*)>(_a[1]))); break;
+        case 12: _t->showNormalIfMinimized(); break;
+        case 13: _t->toggleHidden(); break;
+        case 14: _t->detectShutdown(); break;
+        case 15: _t->showProgress((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
         default: ;
         }
     } else if (_c == QMetaObject::IndexOfMethod) {
@@ -255,13 +187,13 @@
     if (_id < 0)
         return _id;
     if (_c == QMetaObject::InvokeMetaMethod) {
-        if (_id < 29)
+        if (_id < 16)
             qt_static_metacall(this, _c, _id, _a);
-        _id -= 29;
+        _id -= 16;
     } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
-        if (_id < 29)
+        if (_id < 16)
             *reinterpret_cast<int*>(_a[0]) = -1;
-        _id -= 29;
+        _id -= 16;
     }
     return _id;
 }

The slots for selecting tabs are missing in the out-of-tree build!
This could be a matter of Qt's moc not finding the right bitcoin-config.h, or alternatively, not getting -DHAVE_CONFIG_H, and therefore getting a wrong value for ENABLE_WALLET.

Edit: the -I. is missing for the moc lines:

-DHAVE_CONFIG_H -I. qt/bitcoingui.h

Becomes

-DHAVE_CONFIG_H -I../../bitcoin-clean/src ../../bitcoin-clean/src/qt/bitcoingui.h
Member

laanwj commented Apr 20, 2016

@cfields I think I found the issue, or at least one symptom - the .moc file is different between the out-of-tree and normal builds:

--- bitcoin/src/qt/moc_bitcoingui.cpp   2016-04-20 15:31:42.627847820 +0200
+++ bitcoin-build/src/qt/moc_bitcoingui.cpp 2016-04-20 15:17:04.295881358 +0200
@@ -5,7 +5,7 @@
 ** WARNING! All changes made in this file will be lost!
 *****************************************************************************/

-#include "qt/bitcoingui.h"
+#include "../../bitcoin-clean/src/qt/bitcoingui.h"
 #include <QtCore/qbytearray.h>
 #include <QtCore/qmetatype.h>
 #if !defined(Q_MOC_OUTPUT_REVISION)
@@ -18,8 +18,8 @@

 QT_BEGIN_MOC_NAMESPACE
 struct qt_meta_stringdata_BitcoinGUI_t {
-    QByteArrayData data[49];
-    char stringdata[642];
+    QByteArrayData data[28];
+    char stringdata[372];
 };
 #define QT_MOC_LITERAL(idx, ofs, len) \
     Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
@@ -42,54 +42,26 @@
 QT_MOC_LITERAL(11, 111, 5),
 QT_MOC_LITERAL(12, 117, 5),
 QT_MOC_LITERAL(13, 123, 3),
-QT_MOC_LITERAL(14, 127, 19),
-QT_MOC_LITERAL(15, 147, 6),
-QT_MOC_LITERAL(16, 154, 20),
-QT_MOC_LITERAL(17, 175, 18),
-QT_MOC_LITERAL(18, 194, 9),
-QT_MOC_LITERAL(19, 204, 19),
-QT_MOC_LITERAL(20, 224, 4),
-QT_MOC_LITERAL(21, 229, 4),
-QT_MOC_LITERAL(22, 234, 7),
-QT_MOC_LITERAL(23, 242, 6),
-QT_MOC_LITERAL(24, 249, 4),
-QT_MOC_LITERAL(25, 254, 7),
-QT_MOC_LITERAL(26, 262, 5),
-QT_MOC_LITERAL(27, 268, 16),
-QT_MOC_LITERAL(28, 285, 15),
-QT_MOC_LITERAL(29, 301, 20),
-QT_MOC_LITERAL(30, 322, 17),
-QT_MOC_LITERAL(31, 340, 4),
-QT_MOC_LITERAL(32, 345, 18),
-QT_MOC_LITERAL(33, 364, 20),
-QT_MOC_LITERAL(34, 385, 11),
-QT_MOC_LITERAL(35, 397, 14),
-QT_MOC_LITERAL(36, 412, 12),
-QT_MOC_LITERAL(37, 425, 15),
-QT_MOC_LITERAL(38, 441, 30),
-QT_MOC_LITERAL(39, 472, 22),
-QT_MOC_LITERAL(40, 495, 17),
-QT_MOC_LITERAL(41, 513, 33),
-QT_MOC_LITERAL(42, 547, 6),
-QT_MOC_LITERAL(43, 554, 21),
-QT_MOC_LITERAL(44, 576, 13),
-QT_MOC_LITERAL(45, 590, 12),
-QT_MOC_LITERAL(46, 603, 14),
-QT_MOC_LITERAL(47, 618, 12),
-QT_MOC_LITERAL(48, 631, 9)
+QT_MOC_LITERAL(14, 127, 14),
+QT_MOC_LITERAL(15, 142, 12),
+QT_MOC_LITERAL(16, 155, 15),
+QT_MOC_LITERAL(17, 171, 30),
+QT_MOC_LITERAL(18, 202, 22),
+QT_MOC_LITERAL(19, 225, 17),
+QT_MOC_LITERAL(20, 243, 33),
+QT_MOC_LITERAL(21, 277, 6),
+QT_MOC_LITERAL(22, 284, 21),
+QT_MOC_LITERAL(23, 306, 13),
+QT_MOC_LITERAL(24, 320, 12),
+QT_MOC_LITERAL(25, 333, 14),
+QT_MOC_LITERAL(26, 348, 12),
+QT_MOC_LITERAL(27, 361, 9)
     },
     "BitcoinGUI\0receivedURI\0\0uri\0"
     "setNumConnections\0count\0setNumBlocks\0"
     "blockDate\0nVerificationProgress\0message\0"
-    "title\0style\0bool*\0ret\0setEncryptionStatus\0"
-    "status\0handlePaymentRequest\0"
-    "SendCoinsRecipient\0recipient\0"
-    "incomingTransaction\0date\0unit\0CAmount\0"
-    "amount\0type\0address\0label\0gotoOverviewPage\0"
-    "gotoHistoryPage\0gotoReceiveCoinsPage\0"
-    "gotoSendCoinsPage\0addr\0gotoSignMessageTab\0"
-    "gotoVerifyMessageTab\0openClicked\0"
-    "optionsClicked\0aboutClicked\0showDebugWindow\0"
+    "title\0style\0bool*\0ret\0optionsClicked\0"
+    "aboutClicked\0showDebugWindow\0"
     "showDebugWindowActivateConsole\0"
     "showHelpMessageClicked\0trayIconActivated\0"
     "QSystemTrayIcon::ActivationReason\0"
@@ -105,7 +77,7 @@
        7,       // revision
        0,       // classname
        0,    0, // classinfo
-      29,   14, // methods
+      16,   14, // methods
        0,    0, // properties
        0,    0, // enums/sets
        0,    0, // constructors
@@ -113,37 +85,24 @@
        1,       // signalCount

  // signals: name, argc, parameters, tag, flags
-       1,    1,  159,    2, 0x06,
+       1,    1,   94,    2, 0x06,

  // slots: name, argc, parameters, tag, flags
-       4,    1,  162,    2, 0x0a,
-       6,    3,  165,    2, 0x0a,
-       9,    4,  172,    2, 0x0a,
-       9,    3,  181,    2, 0x2a,
-      14,    1,  188,    2, 0x0a,
-      16,    1,  191,    2, 0x0a,
-      19,    6,  194,    2, 0x0a,
-      27,    0,  207,    2, 0x08,
-      28,    0,  208,    2, 0x08,
-      29,    0,  209,    2, 0x08,
-      30,    1,  210,    2, 0x08,
-      30,    0,  213,    2, 0x28,
-      32,    1,  214,    2, 0x08,
-      32,    0,  217,    2, 0x28,
-      33,    1,  218,    2, 0x08,
-      33,    0,  221,    2, 0x28,
-      34,    0,  222,    2, 0x08,
-      35,    0,  223,    2, 0x08,
-      36,    0,  224,    2, 0x08,
-      37,    0,  225,    2, 0x08,
-      38,    0,  226,    2, 0x08,
-      39,    0,  227,    2, 0x08,
-      40,    1,  228,    2, 0x08,
-      43,    1,  231,    2, 0x08,
-      43,    0,  234,    2, 0x28,
-      45,    0,  235,    2, 0x08,
-      46,    0,  236,    2, 0x08,
-      47,    2,  237,    2, 0x08,
+       4,    1,   97,    2, 0x0a,
+       6,    3,  100,    2, 0x0a,
+       9,    4,  107,    2, 0x0a,
+       9,    3,  116,    2, 0x2a,
+      14,    0,  123,    2, 0x08,
+      15,    0,  124,    2, 0x08,
+      16,    0,  125,    2, 0x08,
+      17,    0,  126,    2, 0x08,
+      18,    0,  127,    2, 0x08,
+      19,    1,  128,    2, 0x08,
+      22,    1,  131,    2, 0x08,
+      22,    0,  134,    2, 0x28,
+      24,    0,  135,    2, 0x08,
+      25,    0,  136,    2, 0x08,
+      26,    2,  137,    2, 0x08,

  // signals: parameters
     QMetaType::Void, QMetaType::QString,    3,
@@ -153,30 +112,17 @@
     QMetaType::Void, QMetaType::Int, QMetaType::QDateTime, QMetaType::Double,    5,    7,    8,
     QMetaType::Void, QMetaType::QString, QMetaType::QString, QMetaType::UInt, 0x80000000 | 12,   10,    9,   11,   13,
     QMetaType::Void, QMetaType::QString, QMetaType::QString, QMetaType::UInt,   10,    9,   11,
-    QMetaType::Void, QMetaType::Int,   15,
-    QMetaType::Bool, 0x80000000 | 17,   18,
-    QMetaType::Void, QMetaType::QString, QMetaType::Int, 0x80000000 | 22, QMetaType::QString, QMetaType::QString, QMetaType::QString,   20,   21,   23,   24,   25,   26,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
-    QMetaType::Void,
-    QMetaType::Void, QMetaType::QString,   31,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void,
-    QMetaType::Void, 0x80000000 | 41,   42,
-    QMetaType::Void, QMetaType::Bool,   44,
+    QMetaType::Void, 0x80000000 | 20,   21,
+    QMetaType::Void, QMetaType::Bool,   23,
     QMetaType::Void,
     QMetaType::Void,
     QMetaType::Void,
-    QMetaType::Void, QMetaType::QString, QMetaType::Int,   10,   48,
+    QMetaType::Void, QMetaType::QString, QMetaType::Int,   10,   27,

        0        // eod
 };
@@ -191,31 +137,17 @@
         case 2: _t->setNumBlocks((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< const QDateTime(*)>(_a[2])),(*reinterpret_cast< double(*)>(_a[3]))); break;
         case 3: _t->message((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< uint(*)>(_a[3])),(*reinterpret_cast< bool*(*)>(_a[4]))); break;
         case 4: _t->message((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2])),(*reinterpret_cast< uint(*)>(_a[3]))); break;
-        case 5: _t->setEncryptionStatus((*reinterpret_cast< int(*)>(_a[1]))); break;
-        case 6: { bool _r = _t->handlePaymentRequest((*reinterpret_cast< const SendCoinsRecipient(*)>(_a[1])));
-            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
-        case 7: _t->incomingTransaction((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< const CAmount(*)>(_a[3])),(*reinterpret_cast< const QString(*)>(_a[4])),(*reinterpret_cast< const QString(*)>(_a[5])),(*reinterpret_cast< const QString(*)>(_a[6]))); break;
-        case 8: _t->gotoOverviewPage(); break;
-        case 9: _t->gotoHistoryPage(); break;
-        case 10: _t->gotoReceiveCoinsPage(); break;
-        case 11: _t->gotoSendCoinsPage((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 12: _t->gotoSendCoinsPage(); break;
-        case 13: _t->gotoSignMessageTab((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 14: _t->gotoSignMessageTab(); break;
-        case 15: _t->gotoVerifyMessageTab((*reinterpret_cast< QString(*)>(_a[1]))); break;
-        case 16: _t->gotoVerifyMessageTab(); break;
-        case 17: _t->openClicked(); break;
-        case 18: _t->optionsClicked(); break;
-        case 19: _t->aboutClicked(); break;
-        case 20: _t->showDebugWindow(); break;
-        case 21: _t->showDebugWindowActivateConsole(); break;
-        case 22: _t->showHelpMessageClicked(); break;
-        case 23: _t->trayIconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
-        case 24: _t->showNormalIfMinimized((*reinterpret_cast< bool(*)>(_a[1]))); break;
-        case 25: _t->showNormalIfMinimized(); break;
-        case 26: _t->toggleHidden(); break;
-        case 27: _t->detectShutdown(); break;
-        case 28: _t->showProgress((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
+        case 5: _t->optionsClicked(); break;
+        case 6: _t->aboutClicked(); break;
+        case 7: _t->showDebugWindow(); break;
+        case 8: _t->showDebugWindowActivateConsole(); break;
+        case 9: _t->showHelpMessageClicked(); break;
+        case 10: _t->trayIconActivated((*reinterpret_cast< QSystemTrayIcon::ActivationReason(*)>(_a[1]))); break;
+        case 11: _t->showNormalIfMinimized((*reinterpret_cast< bool(*)>(_a[1]))); break;
+        case 12: _t->showNormalIfMinimized(); break;
+        case 13: _t->toggleHidden(); break;
+        case 14: _t->detectShutdown(); break;
+        case 15: _t->showProgress((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
         default: ;
         }
     } else if (_c == QMetaObject::IndexOfMethod) {
@@ -255,13 +187,13 @@
     if (_id < 0)
         return _id;
     if (_c == QMetaObject::InvokeMetaMethod) {
-        if (_id < 29)
+        if (_id < 16)
             qt_static_metacall(this, _c, _id, _a);
-        _id -= 29;
+        _id -= 16;
     } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
-        if (_id < 29)
+        if (_id < 16)
             *reinterpret_cast<int*>(_a[0]) = -1;
-        _id -= 29;
+        _id -= 16;
     }
     return _id;
 }

The slots for selecting tabs are missing in the out-of-tree build!
This could be a matter of Qt's moc not finding the right bitcoin-config.h, or alternatively, not getting -DHAVE_CONFIG_H, and therefore getting a wrong value for ENABLE_WALLET.

Edit: the -I. is missing for the moc lines:

-DHAVE_CONFIG_H -I. qt/bitcoingui.h

Becomes

-DHAVE_CONFIG_H -I../../bitcoin-clean/src ../../bitcoin-clean/src/qt/bitcoingui.h
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 20, 2016

Member

@theuni The following solved it for me:

diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 8443fe6..3b39919 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -424,11 +424,11 @@ ui_%.h: %.ui
        $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false)

 %.moc: %.cpp
-       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \
+       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \
          $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@

 moc_%.cpp: %.h
-       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \
+       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \
          $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@

 %.qm: %.ts
Member

laanwj commented Apr 20, 2016

@theuni The following solved it for me:

diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index 8443fe6..3b39919 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -424,11 +424,11 @@ ui_%.h: %.ui
        $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false)

 %.moc: %.cpp
-       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \
+       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \
          $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@

 moc_%.cpp: %.h
-       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \
+       $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \
          $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@

 %.qm: %.ts
@theuni

This comment has been minimized.

Show comment
Hide comment
@theuni

theuni Apr 20, 2016

Member

@sipa Fine by me.

@laanwj Thanks for tracking that down! Yes, that must've been a very confusing result :)

There are a few other fixes needed for out-of-tree builds.

  • RCC is particularly unhappy with separate paths, so we have a hackish copy in there right now. I'm sure there's a better way.
  • We do some leveldb copying at the top-level make that should no longer be necessary.
  • Travis and Gitian descriptors should be switched to out-of-tree rather than copying to subtree as they are now

I'd prefer to do those as a separate PR, but I can tack them on here if you'd prefer.

Member

theuni commented Apr 20, 2016

@sipa Fine by me.

@laanwj Thanks for tracking that down! Yes, that must've been a very confusing result :)

There are a few other fixes needed for out-of-tree builds.

  • RCC is particularly unhappy with separate paths, so we have a hackish copy in there right now. I'm sure there's a better way.
  • We do some leveldb copying at the top-level make that should no longer be necessary.
  • Travis and Gitian descriptors should be switched to out-of-tree rather than copying to subtree as they are now

I'd prefer to do those as a separate PR, but I can tack them on here if you'd prefer.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 21, 2016

Member

I'd prefer including the changes that get out-of-tree build working here (so that we don't have an intermediate state with known brokenness). I agree with doing optimizations and improvements, as well as using it in gitian separately.

Member

laanwj commented Apr 21, 2016

I'd prefer including the changes that get out-of-tree build working here (so that we don't have an intermediate state with known brokenness). I agree with doing optimizations and improvements, as well as using it in gitian separately.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Apr 22, 2016

Member

Ok, just going ahead and merging this. I'll submit the qt fix myself.

Member

laanwj commented Apr 22, 2016

Ok, just going ahead and merging this. I'll submit the qt fix myself.

@laanwj laanwj merged commit a4625ac into bitcoin:master Apr 22, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Apr 22, 2016

Merge #7911: leveldb: integrate leveldb into our buildsystem
a4625ac leveldb: integrate leveldb into our buildsystem (Cory Fields)

laanwj added a commit to laanwj/bitcoin that referenced this pull request Apr 22, 2016

qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

jmcorgan added a commit to jmcorgan/bitcoin that referenced this pull request Jun 8, 2016

Cherry-pick of f59dceb (#7925) to 0.12.
=====

qt: Fix out-of-tree GUI builds

Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

thokon00 added a commit to faircoin/faircoin that referenced this pull request Jun 28, 2016

Cherry-pick of f59dceb (#7925) to 0.12.
=====

qt: Fix out-of-tree GUI builds

Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 12, 2016

Cherry-pick of f59dceb (#7925) to 0.12.
=====

qt: Fix out-of-tree GUI builds

Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 12, 2016

Cherry-pick of f59dceb (#7925) to 0.12.
=====

qt: Fix out-of-tree GUI builds

Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

nomnombtc added a commit to nomnombtc/bitcoin that referenced this pull request Nov 13, 2016

Cherry-pick of f59dceb (#7925) to 0.12.
=====

qt: Fix out-of-tree GUI builds

Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

sickpig added a commit to sickpig/BitcoinUnlimited that referenced this pull request Jan 4, 2017

qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin/bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

protonn added a commit to argentumproject/argentum that referenced this pull request Apr 11, 2017

qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

lateminer added a commit to lateminer/bitcoin that referenced this pull request Jan 4, 2018

qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.

lateminer added a commit to lateminer/bitcoin that referenced this pull request Jan 4, 2018

qt: Fix out-of-tree GUI builds
Without this patch:

- When I compile the GUI from the bitcoin directory itself, it works as
  expected.

- When I build the GUI in an out-of-tree build, I cannot get it to
  select tabs. When I click, say the "Receive" tab nothing happens,
  the button selects but it doesn't switch the page. The rest - even
  the debug window - seems to work.

See full discussion here:
bitcoin#7911 (comment)

This turned out to be caused by a mismatch in the arguments to moc,
preventing it from finding `bitcoin-config.h`. Fix this by passing
`$(DEFAULT_INCLUDES)` to it, which gets set to the appropriate
path by autoconf itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment