Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Oct 21, 2014

If after compile one introduces errores in say, chainparams, make will compile main before founding the errors.
This change doesn't guarantee that the dependencies will compiled in the correct order, but it's a short term solution for convenience.

@laanwj
Copy link
Member

laanwj commented Oct 21, 2014

I prefer to not enforce any specific build order to leave space for maximum parallelism.

But I see that this just switches around the order which is fine by me. I'd only suggest to add a comment why it is this way, to avoid people changing it again.

@theuni
Copy link
Member

theuni commented Oct 21, 2014

ACK in principle, but this needs to be reordered for the bin targets as well. This fixes the general "make" and "make check" cases, but not the specific cases like "make bitcoind". See below for (untested) changes needed in addition to yours.

Also, this will work itself out soon anyway as we begin shifting libs around as a core lib starts to emerge, but I have no issue with rearranging before that. This way is arguably more correct anyway.

diff --git a/src/Makefile.am b/src/Makefile.am
index 155adfe..980361d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -259,8 +259,8 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h

 # bitcoind binary #
 bitcoind_LDADD = \
-  $(LIBBITCOIN_SERVER) \
   $(LIBBITCOIN_COMMON) \
+  $(LIBBITCOIN_SERVER) \
   $(LIBBITCOIN_UNIVALUE) \
   $(LIBBITCOIN_UTIL) \
   $(LIBBITCOIN_CRYPTO) \
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index f8f4439..561e033 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -358,11 +358,11 @@ endif
 if TARGET_WINDOWS
   qt_bitcoin_qt_SOURCES += $(BITCOIN_RC)
 endif
-qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
+qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
 if ENABLE_WALLET
 qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
 endif
-qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
+qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
   $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
 if USE_LIBSECP256K1
   qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
index 23375be..b3ef9a8 100644
--- a/src/Makefile.qttest.include
+++ b/src/Makefile.qttest.include
@@ -26,11 +26,11 @@ endif

 nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)

-qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
+qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
 if ENABLE_WALLET
 qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
 endif
-qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
+qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
   $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
   $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
 if USE_LIBSECP256K1
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
cory@cory-i7:~/dev/bitcoin/src(reducedeps3)$ git --no-pager diff Makefile.am Makefile.test.include Makefile.qttest.include Makefile.qt.include
diff --git a/src/Makefile.am b/src/Makefile.am
index 155adfe..980361d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -259,8 +259,8 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h

 # bitcoind binary #
 bitcoind_LDADD = \
-  $(LIBBITCOIN_SERVER) \
   $(LIBBITCOIN_COMMON) \
+  $(LIBBITCOIN_SERVER) \
   $(LIBBITCOIN_UNIVALUE) \
   $(LIBBITCOIN_UTIL) \
   $(LIBBITCOIN_CRYPTO) \
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index f8f4439..561e033 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -358,11 +358,11 @@ endif
 if TARGET_WINDOWS
   qt_bitcoin_qt_SOURCES += $(BITCOIN_RC)
 endif
-qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)
+qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
 if ENABLE_WALLET
 qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
 endif
-qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
+qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
   $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
 if USE_LIBSECP256K1
   qt_bitcoin_qt_LDADD += secp256k1/libsecp256k1.la
diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include
index 23375be..b3ef9a8 100644
--- a/src/Makefile.qttest.include
+++ b/src/Makefile.qttest.include
@@ -26,11 +26,11 @@ endif

 nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP)

-qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)
+qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER)
 if ENABLE_WALLET
 qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET)
 endif
-qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
+qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) \
   $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \
   $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
 if USE_LIBSECP256K1
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index b20e226..deaf97b 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -79,7 +79,7 @@ endif

 test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
 test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
-test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
+test_test_bitcoin_LDADD = $(LIBBITCOIN_COMMON) $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
   $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
 if ENABLE_WALLET
 test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)

@laanwj
Copy link
Member

laanwj commented Oct 22, 2014

@theuni The order of libraries in the linking phase is important, if LIBBITCOIN_SERVER uses symbols from LIBBITCOIN_COMMON then they should be in that order. Right? I don't think reordering them in the binaries is as harmless as @jtimon's change.

@theuni
Copy link
Member

theuni commented Oct 24, 2014

@laanwj Yes, of course. Ignore that comment.

Building for specific targets will still go in the old order, but @jtimon's change is still an improvement.

@jtimon
Copy link
Contributor Author

jtimon commented Oct 27, 2014

Rebased with comment and a few additional ordering changes.

src/Makefile.am Outdated
Copy link
Member

Choose a reason for hiding this comment

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

remove the \ here and add one after crypto.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opps

@laanwj laanwj merged commit 071473c into bitcoin:master Oct 27, 2014
laanwj added a commit that referenced this pull request Oct 27, 2014
071473c Build util and common before building server (jtimon)
@jtimon jtimon mentioned this pull request Nov 28, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants